From 8a163ea2ba952b1ea35cbb815bda999af6b58489 Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Sun, 29 Dec 2024 15:45:32 -0700 Subject: [PATCH] [c86 libc] Move ioctl and _lseek to syscall.s for smaller executables --- libc/c86/c86lib.s | 4 +++- libc/c86/syscall.s | 11 +++++++++++ libc/c86/syscall2.s | 10 ---------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/libc/c86/c86lib.s b/libc/c86/c86lib.s index b130c5e72..e19a7ebbe 100644 --- a/libc/c86/c86lib.s +++ b/libc/c86/c86lib.s @@ -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 diff --git a/libc/c86/syscall.s b/libc/c86/syscall.s index 757dd00dc..0e560fa03 100644 --- a/libc/c86/syscall.s +++ b/libc/c86/syscall.s @@ -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 + diff --git a/libc/c86/syscall2.s b/libc/c86/syscall2.s index d391bbe8a..8342c6e4d 100644 --- a/libc/c86/syscall2.s +++ b/libc/c86/syscall2.s @@ -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 @@ -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