• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1	.global __cp_begin
2	.hidden __cp_begin
3	.global __cp_end
4	.hidden __cp_end
5	.global __cp_cancel
6	.hidden __cp_cancel
7	.hidden __cancel
8	.global __syscall_cp_asm
9	.hidden __syscall_cp_asm
10	.text
11	.type   __syscall_cp_asm,%function
12__syscall_cp_asm:
13	# at enter: r3 = pointer to self->cancel, r4: syscall no, r5: first arg, r6: 2nd, r7: 3rd, r8: 4th, r9: 5th, r10: 6th
14__cp_begin:
15	# if (self->cancel) goto __cp_cancel
16	lwz   0, 0(3)
17	cmpwi cr7, 0, 0
18	bne-  cr7, __cp_cancel
19
20	# make syscall
21	mr    0,  4
22	mr    3,  5
23	mr    4,  6
24	mr    5,  7
25	mr    6,  8
26	mr    7,  9
27	mr    8, 10
28	sc
29
30__cp_end:
31	# return error ? -r3 : r3
32	bnslr+
33	neg 3, 3
34	blr
35
36__cp_cancel:
37	mflr 0
38	bl 1f
39	.long .TOC.-.
401:	mflr 3
41	lwa 2, 0(3)
42	add 2, 2, 3
43	mtlr 0
44	b __cancel
45