libk  Check-in [6022ec08ab]

Overview
Comment:Push r15 in linux x64 syscall This was causing the static, release, build of kcli.testbin to subtly segfault shortly after writing the first buffer. Still not sure why kcore.testbin seemingly wasn't affected, nor why the shared build still breaks worse.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6022ec08abfd871e309c6538becb465702b77cfb76e3f76b3f7ac98af7986aa7
User & Date: glowpelt on 2020-01-30 07:13:19
Other Links: manifest | tags
Context
2020-01-30
07:15
Merge the shared library build fixes into trunk check-in: d49a706cc4 user: glowpelt tags: trunk
07:13
Push r15 in linux x64 syscall This was causing the static, release, build of kcli.testbin to subtly segfault shortly after writing the first buffer. Still not sure why kcore.testbin seemingly wasn't affected, nor why the shared build still breaks worse. check-in: 6022ec08ab user: glowpelt tags: trunk
2020-01-19
04:12
Partially fix shared library build by making sure that data_objects are linked in. This means that internal.ident.o is properly linked in, but internal.ident.o itself still references undefined symbols, so this is only a partial fix. check-in: 0d71b71cc8 user: glowpelt tags: trunk
Changes

Modified mod/kcore/syscall.fn.x86.lin.64.s from [3fa83c18de] to [a731f1dad0].

32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
..
99
100
101
102
103
104
105
106

107
108
	;         r12 = u64* errno
	; arg 0 = s64* result
	; arg 1 = errno ptr
	; arg 2 = syscall num
	; arg 3 = valency
	; arg 4 = args ptr

	; we use two registers that are supposed
	; to be callee-saved, so we need to
	; push them to the stack and then pop
	; them back off just before the fn rets.
	push rbx
	push r12


	; store the locals in registers that
	; are guaranteed not to be clobbered,
	; saving us some cycles pushing to
	; and popping back from the stack
	mov rbx, ccall.reg.0
	mov r12, ccall.reg.1
................................................................................
	; the errno to its positive equivalent,
	; and store -1 in the return variable
	.error: neg sys.reg.ret
	        mov qword [rbx], -1
			mov       [r12], sys.reg.ret
			jmp .return

	.return: pop r12

	         pop rbx
			 ret







|





>







 







|
>


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
...
100
101
102
103
104
105
106
107
108
109
110
	;         r12 = u64* errno
	; arg 0 = s64* result
	; arg 1 = errno ptr
	; arg 2 = syscall num
	; arg 3 = valency
	; arg 4 = args ptr

	; we use three registers that are supposed
	; to be callee-saved, so we need to
	; push them to the stack and then pop
	; them back off just before the fn rets.
	push rbx
	push r12
	push r15

	; store the locals in registers that
	; are guaranteed not to be clobbered,
	; saving us some cycles pushing to
	; and popping back from the stack
	mov rbx, ccall.reg.0
	mov r12, ccall.reg.1
................................................................................
	; the errno to its positive equivalent,
	; and store -1 in the return variable
	.error: neg sys.reg.ret
	        mov qword [rbx], -1
			mov       [r12], sys.reg.ret
			jmp .return

	.return: pop r15 
		 pop r12
	         pop rbx
			 ret