From e729eba84d6f7e4e785235f7155294105b876e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 4 Nov 2002 18:49:49 +0000 Subject: [PATCH] Merged several object files together - there are now posix_xxx.o and kernel_posix_xxx.o, where xxx stands for stdio/stdlib/unistd/... sleep.c and usleep.c no longer reference sys_() calls directly, but call the OS functions instead (snooze_until(), and system_time()). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1839 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/os/Jamfile | 2 +- src/kernel/libroot/os/arch/x86/Jamfile | 8 +++- src/kernel/libroot/posix/Jamfile | 7 ++- src/kernel/libroot/posix/locale/Jamfile | 6 ++- src/kernel/libroot/posix/malloc/Jamfile | 2 +- src/kernel/libroot/posix/math/Jamfile | 2 +- .../libroot/posix/math/arch/x86/Jamfile | 9 +++- src/kernel/libroot/posix/stdio/Jamfile | 10 ++++- src/kernel/libroot/posix/stdlib/Jamfile | 20 ++++++++- src/kernel/libroot/posix/string/Jamfile | 2 +- src/kernel/libroot/posix/sys/Jamfile | 9 +++- src/kernel/libroot/posix/unistd/Jamfile | 44 ++++++++++++++----- src/kernel/libroot/posix/unistd/sleep.c | 18 +++----- src/kernel/libroot/posix/unistd/usleep.c | 2 +- 14 files changed, 106 insertions(+), 35 deletions(-) diff --git a/src/kernel/libroot/os/Jamfile b/src/kernel/libroot/os/Jamfile index bcbea8fc56..e6595b7b6a 100644 --- a/src/kernel/libroot/os/Jamfile +++ b/src/kernel/libroot/os/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot os ; -KernelObjects +KernelMergeObject os_main.o : <$(SOURCE_GRIST)>area.c <$(SOURCE_GRIST)>debug.c <$(SOURCE_GRIST)>fs_attr.c diff --git a/src/kernel/libroot/os/arch/x86/Jamfile b/src/kernel/libroot/os/arch/x86/Jamfile index afaf27c216..68c1b547b1 100644 --- a/src/kernel/libroot/os/arch/x86/Jamfile +++ b/src/kernel/libroot/os/arch/x86/Jamfile @@ -1,9 +1,15 @@ SubDir OBOS_TOP src kernel libroot os arch x86 ; -KernelObjects +KernelMergeObject os_arch_$(OBOS_ARCH).o : <$(SOURCE_GRIST)>atomic.S <$(SOURCE_GRIST)>cpuid.S : -fPIC -DPIC ; +MergeObjectFromObjects kernel_os_arch_$(OBOS_ARCH).o : + # ToDo: remove atomic_xxx() functions from the kernel's libx86.a + #<$(SOURCE_GRIST)>atomic.o + <$(SOURCE_GRIST)>cpuid.o + ; + diff --git a/src/kernel/libroot/posix/Jamfile b/src/kernel/libroot/posix/Jamfile index 53c07a4f0d..a1a9a9b196 100644 --- a/src/kernel/libroot/posix/Jamfile +++ b/src/kernel/libroot/posix/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix ; -KernelObjects +KernelMergeObject posix_main.o : <$(SOURCE_GRIST)>dlfcn.c <$(SOURCE_GRIST)>errno.c <$(SOURCE_GRIST)>fnmatch.c @@ -12,6 +12,11 @@ KernelObjects -fPIC -DPIC ; +MergeObjectFromObjects kernel_posix_main.o : + <$(SOURCE_GRIST)>errno.o + <$(SOURCE_GRIST)>poll.o + ; + SubInclude OBOS_TOP src kernel libroot posix malloc ; SubInclude OBOS_TOP src kernel libroot posix locale ; SubInclude OBOS_TOP src kernel libroot posix stdio ; diff --git a/src/kernel/libroot/posix/locale/Jamfile b/src/kernel/libroot/posix/locale/Jamfile index 0531a7457c..94e70da176 100644 --- a/src/kernel/libroot/posix/locale/Jamfile +++ b/src/kernel/libroot/posix/locale/Jamfile @@ -1,8 +1,12 @@ SubDir OBOS_TOP src kernel libroot posix locale ; -KernelObjects +KernelMergeObject posix_locale.o : <$(SOURCE_GRIST)>ctype.c <$(SOURCE_GRIST)>localeconv.c : -fPIC -DPIC ; + +MergeObjectFromObjects kernel_posix_locale.o : + <$(SOURCE_GRIST)>ctype.o + ; diff --git a/src/kernel/libroot/posix/malloc/Jamfile b/src/kernel/libroot/posix/malloc/Jamfile index 0fb946b77f..8ef2235f8b 100644 --- a/src/kernel/libroot/posix/malloc/Jamfile +++ b/src/kernel/libroot/posix/malloc/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix malloc ; -KernelObjects +KernelMergeObject posix_malloc.o : <$(SOURCE_GRIST)>arch-specific.cpp <$(SOURCE_GRIST)>heap.cpp <$(SOURCE_GRIST)>processheap.cpp diff --git a/src/kernel/libroot/posix/math/Jamfile b/src/kernel/libroot/posix/math/Jamfile index 3b9ab3c721..4ec99f02bb 100644 --- a/src/kernel/libroot/posix/math/Jamfile +++ b/src/kernel/libroot/posix/math/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix math ; -KernelObjects +KernelMergeObject posix_math.o : <$(SOURCE_GRIST)>acosh.c <$(SOURCE_GRIST)>asincos.c <$(SOURCE_GRIST)>asinh.c diff --git a/src/kernel/libroot/posix/math/arch/x86/Jamfile b/src/kernel/libroot/posix/math/arch/x86/Jamfile index 69c658372b..b811d74b43 100644 --- a/src/kernel/libroot/posix/math/arch/x86/Jamfile +++ b/src/kernel/libroot/posix/math/arch/x86/Jamfile @@ -1,3 +1,10 @@ SubDir OBOS_TOP src kernel libroot posix math arch x86 ; -KernelObjects fabs.S frexp.c isinf.c ldexp.c ; +KernelMergeObject posix_math_arch_$(OBOS_ARCH).o : + <$(SOURCE_GRIST)>fabs.S + <$(SOURCE_GRIST)>frexp.c + <$(SOURCE_GRIST)>isinf.c + <$(SOURCE_GRIST)>ldexp.c + : + -fPIC -DPIC + ; diff --git a/src/kernel/libroot/posix/stdio/Jamfile b/src/kernel/libroot/posix/stdio/Jamfile index c222cfc098..aea3ec1ba2 100644 --- a/src/kernel/libroot/posix/stdio/Jamfile +++ b/src/kernel/libroot/posix/stdio/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix stdio ; -KernelObjects +KernelMergeObject posix_stdio.o : <$(SOURCE_GRIST)>fclose.c <$(SOURCE_GRIST)>feof.c <$(SOURCE_GRIST)>fflush.c @@ -23,7 +23,6 @@ KernelObjects <$(SOURCE_GRIST)>getchar.c <$(SOURCE_GRIST)>gets.c <$(SOURCE_GRIST)>getw.c - <$(SOURCE_GRIST)>kvsprintf.c <$(SOURCE_GRIST)>makebuf.c <$(SOURCE_GRIST)>printf.c <$(SOURCE_GRIST)>putc.c @@ -46,3 +45,10 @@ KernelObjects : -fPIC -DPIC ; + +KernelMergeObject kernel_posix_stdio.o : + <$(SOURCE_GRIST)>kvsprintf.c + : + -fPIC -DPIC + ; + diff --git a/src/kernel/libroot/posix/stdlib/Jamfile b/src/kernel/libroot/posix/stdlib/Jamfile index c816d7f15f..a11f3230cc 100644 --- a/src/kernel/libroot/posix/stdlib/Jamfile +++ b/src/kernel/libroot/posix/stdlib/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix stdlib ; -KernelObjects +KernelMergeObject posix_stdlib.o : <$(SOURCE_GRIST)>abs.c <$(SOURCE_GRIST)>assert.c <$(SOURCE_GRIST)>atof.c @@ -25,3 +25,21 @@ KernelObjects : -fPIC -DPIC ; + +MergeObjectFromObjects kernel_posix_stdlib.o : + <$(SOURCE_GRIST)>abs.o + <$(SOURCE_GRIST)>assert.o + <$(SOURCE_GRIST)>atoi.o + <$(SOURCE_GRIST)>bsearch.o + <$(SOURCE_GRIST)>merge.o + <$(SOURCE_GRIST)>qsort.o + <$(SOURCE_GRIST)>rand.o + <$(SOURCE_GRIST)>random.o + <$(SOURCE_GRIST)>strtol.o + <$(SOURCE_GRIST)>strtoll.o + <$(SOURCE_GRIST)>strtoul.o + <$(SOURCE_GRIST)>strtoull.o + : + -fPIC -DPIC + ; + diff --git a/src/kernel/libroot/posix/string/Jamfile b/src/kernel/libroot/posix/string/Jamfile index 961a912294..d7914d6521 100644 --- a/src/kernel/libroot/posix/string/Jamfile +++ b/src/kernel/libroot/posix/string/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix string ; -KernelObjects +KernelMergeObject posix_string.o : <$(SOURCE_GRIST)>memchr.c <$(SOURCE_GRIST)>memcmp.c <$(SOURCE_GRIST)>memcpy.c diff --git a/src/kernel/libroot/posix/sys/Jamfile b/src/kernel/libroot/posix/sys/Jamfile index 7f9a136012..1449bc306d 100644 --- a/src/kernel/libroot/posix/sys/Jamfile +++ b/src/kernel/libroot/posix/sys/Jamfile @@ -1,6 +1,6 @@ SubDir OBOS_TOP src kernel libroot posix sys ; -KernelObjects +KernelMergeObject posix_sys.o : <$(SOURCE_GRIST)>chmod.c <$(SOURCE_GRIST)>stat.c <$(SOURCE_GRIST)>mkdir.c @@ -9,3 +9,10 @@ KernelObjects : -fPIC -DPIC ; + +MergeObjectFromObjects kernel_posix_sys.o : + <$(SOURCE_GRIST)>chmod.o + <$(SOURCE_GRIST)>stat.o + <$(SOURCE_GRIST)>mkdir.o + <$(SOURCE_GRIST)>select.o + ; diff --git a/src/kernel/libroot/posix/unistd/Jamfile b/src/kernel/libroot/posix/unistd/Jamfile index 15706ed25f..942c5b6d67 100644 --- a/src/kernel/libroot/posix/unistd/Jamfile +++ b/src/kernel/libroot/posix/unistd/Jamfile @@ -1,26 +1,48 @@ SubDir OBOS_TOP src kernel libroot posix unistd ; -KernelObjects - <$(SOURCE_GRIST)>access.c - <$(SOURCE_GRIST)>chown.c - <$(SOURCE_GRIST)>close.c +KernelMergeObject posix_unistd.o : + <$(SOURCE_GRIST)>access.c + <$(SOURCE_GRIST)>chown.c + <$(SOURCE_GRIST)>close.c <$(SOURCE_GRIST)>conf.c <$(SOURCE_GRIST)>directory.c - <$(SOURCE_GRIST)>dup.c - <$(SOURCE_GRIST)>dup2.c + <$(SOURCE_GRIST)>dup.c + <$(SOURCE_GRIST)>dup2.c <$(SOURCE_GRIST)>getopt.c <$(SOURCE_GRIST)>hostname.c <$(SOURCE_GRIST)>ioctl.c <$(SOURCE_GRIST)>link.c - <$(SOURCE_GRIST)>lseek.c + <$(SOURCE_GRIST)>lseek.c <$(SOURCE_GRIST)>mount.c <$(SOURCE_GRIST)>open.c - <$(SOURCE_GRIST)>read.c - <$(SOURCE_GRIST)>sleep.c - <$(SOURCE_GRIST)>truncate.c + <$(SOURCE_GRIST)>read.c + <$(SOURCE_GRIST)>sleep.c + <$(SOURCE_GRIST)>truncate.c <$(SOURCE_GRIST)>usergroup.c - <$(SOURCE_GRIST)>usleep.c + <$(SOURCE_GRIST)>usleep.c <$(SOURCE_GRIST)>write.c : -fPIC -DPIC ; + +MergeObjectFromObjects kernel_posix_unistd.o : + <$(SOURCE_GRIST)>access.o + <$(SOURCE_GRIST)>chown.o + <$(SOURCE_GRIST)>close.o + <$(SOURCE_GRIST)>conf.o + <$(SOURCE_GRIST)>directory.o + <$(SOURCE_GRIST)>dup.o + <$(SOURCE_GRIST)>dup2.o + <$(SOURCE_GRIST)>hostname.o + <$(SOURCE_GRIST)>ioctl.o + <$(SOURCE_GRIST)>link.o + <$(SOURCE_GRIST)>lseek.o + <$(SOURCE_GRIST)>mount.o + <$(SOURCE_GRIST)>open.o + <$(SOURCE_GRIST)>read.o +# <$(SOURCE_GRIST)>sleep.o + <$(SOURCE_GRIST)>truncate.o + <$(SOURCE_GRIST)>usergroup.o +# <$(SOURCE_GRIST)>usleep.o + <$(SOURCE_GRIST)>write.o + ; diff --git a/src/kernel/libroot/posix/unistd/sleep.c b/src/kernel/libroot/posix/unistd/sleep.c index 18c8355685..69acd77282 100644 --- a/src/kernel/libroot/posix/unistd/sleep.c +++ b/src/kernel/libroot/posix/unistd/sleep.c @@ -13,19 +13,15 @@ sleep(unsigned seconds) bigtime_t usecs; bigtime_t start; int err; - unsigned retval; - start= sys_system_time(); + start = system_time(); - usecs= 1000000; - usecs*= (bigtime_t) seconds; + usecs = 1000000; + usecs *= (bigtime_t) seconds; - err= sys_snooze_until(start + usecs, B_SYSTEM_TIMEBASE); + err = snooze_until(start + usecs, B_SYSTEM_TIMEBASE); + if (err) + return (unsigned)(system_time() - start); - retval= 0; - if(err) { - retval= (unsigned)(sys_system_time()-start); - } - - return retval; + return 0; } diff --git a/src/kernel/libroot/posix/unistd/usleep.c b/src/kernel/libroot/posix/unistd/usleep.c index 6a00a957d2..de8d5f2669 100644 --- a/src/kernel/libroot/posix/unistd/usleep.c +++ b/src/kernel/libroot/posix/unistd/usleep.c @@ -10,5 +10,5 @@ int usleep(unsigned useconds) { - return sys_snooze_until(sys_system_time() + (bigtime_t)(useconds), B_SYSTEM_TIMEBASE); + return snooze_until(system_time() + (bigtime_t)(useconds), B_SYSTEM_TIMEBASE); }