Skip to content

Commit

Permalink
Merge pull request #2161 from ghaerr/c86lib
Browse files Browse the repository at this point in the history
[c86 libc] Move ioctl and _lseek to syscall.s for smaller executables
  • Loading branch information
ghaerr authored Dec 29, 2024
2 parents 7748baa + 8a163ea commit 2f2c2e1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion libc/c86/c86lib.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
;
; C86 helper functions
;
.data
.extern ___stacklow ; lowest protected SP value
.text
.global ___alloca
.comm ___stacklow,2 ; lowest protected SP value
___alloca:
pop bx ; ret address
pop ax ; alloca size
Expand Down
11 changes: 11 additions & 0 deletions libc/c86/syscall.s
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,14 @@ _open:
_close:
mov ax,#6
jmp callsys

.global __lseek
__lseek:
mov ax,#19
jmp near callsys
.global _ioctl

_ioctl:
mov ax,#54
jmp near callsys

10 changes: 0 additions & 10 deletions libc/c86/syscall2.s
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ _stat:
mov ax,#18
jmp near callsys

.global __lseek
__lseek:
mov ax,#19
jmp near callsys

.global __getpid
__getpid:
mov ax,#20
Expand Down Expand Up @@ -169,11 +164,6 @@ _fcntl:
mov ax,#50
jmp near callsys

.global _ioctl
_ioctl:
mov ax,#54
jmp near callsys

.global _reboot
_reboot:
mov ax,#55
Expand Down

0 comments on commit 2f2c2e1

Please sign in to comment.