8 .global __syscall_cp_asm
9 .hidden __syscall_cp_asm
11 #r0: volatile. may be modified during linkage.
12 #r1: stack frame: 16 byte alignment.
13 #r2: tls/thread pointer on pp32
14 #r3,r4: return values, first args
16 #r11-r12: volatile. may be modified during linkage
17 #r13: "small data area" pointer
18 #r14 - r30: local vars
19 #r31: local or environment pointer
21 #r1, r14-31: belong to the caller, must be saved and restored
22 #r0, r3-r12, ctr, xer: volatile, not preserved
23 #r0,r11,r12: may be altered by cross-module call,
24 #"a func cannot depend on that these regs have the values placed by the caller"
26 #the fields CR2,CR2,CR4 of the cond reg must be preserved
27 #LR (link reg) shall contain the funcs return address
29 .type __syscall_cp_asm,%function
31 # at enter: r3 = pointer to self->cancel, r4: syscall no, r5: first arg, r6: 2nd, r7: 3rd, r8: 4th, r9: 5th, r10: 6th
33 # r3 holds first argument, its a pointer to self->cancel.
34 # we must compare the dereferenced value with 0 and jump to __cancel if its not
36 lwz 0, 0(3) #deref pointer into r0
38 cmpwi cr7, 0, 0 #compare r0 with 0, store result in cr7.
39 beq+ cr7, 1f #jump to label 1 if r0 was 0
41 b __cancel #else call cancel
43 #ok, the cancel flag was not set
44 # syscall: number goes to r0, the rest 3-8
45 mr 0, 4 # put the system call number into r0
46 mr 3, 5 # Shift the arguments: arg1
54 bnslr+ # return if no summary overflow.