ack/plat/osxppc/libsys/lseek.s
George Koehler 02fb480217 Commit a preview of osx386 and osxppc as new platforms.
These produce Mach-o executables for Mac OS X on Intel or PowerPC
processors.  Our code generator for PowerPC (mach/powerpc) still has
bugs.  Some examples seem to run, but startrek crashes.  Our code
generator for Intel (mach/i386) is better.

There is a problem with job control.  If you run paranoia or startrek,
then suspend the job (^Z) and resume it ('fg' in bash), then read(2)
might fail with EINTR.

The larger files in this commit are
 - plat/osx/cvmach/cvmach.c
 - plat/osx/libsys/brk.c
 - plat/osx386/libsys/sigaction.s
 - plat/osxppc/libsys/sigaction.s
2016-10-02 14:58:05 -04:00

14 lines
322 B
ArmAsm

.sect .text
.define _lseek
_lseek:
addi r0, r0, 199 ! lseek
lwz r3, 0(sp) ! fd
! ack passes 4-byte off_t, but system call takes 8-byte off_t
addi r4, r0, 0 ! offset (high word)
lwz r5, 4(sp) ! offset (low word)
lwz r6, 8(sp) ! whence
sc 0
b .set_errno
or r3, r4, r4 ! return offset (low word)
bclr 20, 0, 0