Libraries updates and cleanup

* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
2012-11-15 12:06:41 +01:00
parent f6aac1c3b5
commit f14fb60209
1285 changed files with 44244 additions and 14308 deletions

View File

@@ -1,5 +1,5 @@
#include "kernel.h"
#include "kernel/kernel.h"
#include <minix/minlib.h>
#include <minix/const.h>
#include <minix/cpufeature.h>

View File

@@ -14,7 +14,7 @@
/* sections */
#include <machine/vm.h>
#include "../../kernel.h"
#include "kernel/kernel.h"
#include <minix/config.h>
#include <minix/const.h>
#include <minix/com.h>

View File

@@ -4,7 +4,7 @@
#include <minix/type.h>
#include <libexec.h>
#include <assert.h>
#include "kernel.h"
#include "kernel/kernel.h"
#include "arch_proto.h"
#include <machine/cpu.h>

View File

@@ -1,7 +1,7 @@
#define UNPAGED 1 /* for proper kmain() prototype */
#include "kernel.h"
#include "kernel/kernel.h"
#include <assert.h>
#include <stdlib.h>
#include <minix/minlib.h>

View File

@@ -1,6 +1,6 @@
include "kernel.h"
include "proc.h"
include "kernel/kernel.h"
include "kernel/proc.h"
struct proc
member REG0 p_reg.retreg

View File

@@ -1,16 +1,50 @@
# Makefile for arch-dependent kernel code
.include <bsd.own.mk>
HERE=${.CURDIR}/arch/${MACHINE_ARCH}
.PATH: ${HERE}
# objects we want unpaged from -lminlib, -lminc
# objects we want unpaged from -lminlib
MINLIB_OBJS_UNPAGED=_cpufeature.o _cpuid.o get_bp.o
MINC_OBJS_UNPAGED=strcat.o strlen.o memcpy.o strcpy.o strncmp.o memset.o \
memmove.o strcmp.o atoi.o ctype_.o _stdfile.o strtol.o _errno.o errno.o \
udivdi3.o umoddi3.o qdivrem.o
SYS_OBJS_UNPAGED=kprintf.o vprintf.o assert.o stacktrace.o
_cpufeature.o: ${NETBSDSRCDIR}/lib/libminlib/${MACHINE_ARCH}/_cpufeature.c
_cpuid.o: ${NETBSDSRCDIR}/lib/libminlib/${MACHINE_ARCH}/_cpuid.S
get_bp.o: ${NETBSDSRCDIR}/lib/libminlib/${MACHINE_ARCH}/get_bp.S
# objects we want unpaged from -lsys
SYS_OBJS_UNPAGED=assert.o kprintf.o stacktrace.o vprintf.o
assert.o: ${NETBSDSRCDIR}/lib/libsys/assert.c
kprintf.o: ${NETBSDSRCDIR}/lib/libsys/kprintf.c
stacktrace.o: ${NETBSDSRCDIR}/lib/libsys/stacktrace.c
vprintf.o: ${NETBSDSRCDIR}/lib/libsys/vprintf.c
# objects we want unpaged from -lminc
MINC_OBJS_UNPAGED=findfp.o strcat.o strlen.o memcpy.o strcpy.o strncmp.o \
memset.o memmove.o strcmp.o atoi.o ctype_.o strtol.o \
_errno.o errno.o udivdi3.o umoddi3.o qdivrem.o
memcpy.o: ${NETBSDSRCDIR}/common/lib/libc/string/memcpy.c
memmove.o: ${NETBSDSRCDIR}/common/lib/libc/string/memmove.c
memset.o: ${NETBSDSRCDIR}/common/lib/libc/string/memset.c
strcat.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcat.c
strlen.o: ${NETBSDSRCDIR}/common/lib/libc/string/strlen.c
strcpy.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcpy.c
strcmp.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcmp.c
strncmp.o: ${NETBSDSRCDIR}/common/lib/libc/string/strncmp.c
udivdi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/udivdi3.c
umoddi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/umoddi3.c
qdivrem.o: ${NETBSDSRCDIR}/common/lib/libc/quad/qdivrem.c
atoi.o: ${NETBSDSRCDIR}/lib/libc/stdlib/atoi.c
strtol.o: ${NETBSDSRCDIR}/lib/libc/stdlib/strtol.c
findfp.o: ${NETBSDSRCDIR}/lib/libc/stdio/findfp.c
ctype_.o: ${NETBSDSRCDIR}/lib/libc/gen/ctype_.c
_errno.o: ${NETBSDSRCDIR}/lib/libc/gen/_errno.c
errno.o: ${NETBSDSRCDIR}/lib/libc/gen/errno.c
# Specific flags needed to compile a few of the object files.
CPPFLAGS.strtol.c+= -I ${NETBSDSRCDIR}/common/lib/libc/stdlib
CPPFLAGS.ctype_.c+= -I ${NETBSDSRCDIR}/lib/libc/locale
CPPFLAGS._errno.c+= -I ${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS.assert.c+= -I ${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS.findfp.c+= -I ${NETBSDSRCDIR}/lib/libc/include
# some object files we give a symbol prefix (or namespace) of __k_unpaged_
# that must live in their own unique namespace.
@@ -19,18 +53,12 @@ SYS_OBJS_UNPAGED=kprintf.o vprintf.o assert.o stacktrace.o
io_inb.o pg_utils.o klib.o utility.o arch_reset.o \
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED}
unpaged_${UNPAGED_OBJ}: ${UNPAGED_OBJ}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${UNPAGED_OBJ} unpaged_${UNPAGED_OBJ}
${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${UNPAGED_OBJ} $@
UNPAGED_OBJS += unpaged_${UNPAGED_OBJ}
ORIG_UNPAGED_OBJS += ${UNPAGED_OBJ}
.endfor
# we have to extract some object files from libminc.a and libminlib.a
${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED}: ${LIBMINLIB} ${LIBMINC} ${LIBSYS}
${AR} x ${LIBMINLIB} ${MINLIB_OBJS_UNPAGED}
${AR} x ${LIBMINC} ${MINC_OBJS_UNPAGED}
${AR} x ${LIBSYS} ${SYS_OBJS_UNPAGED}
CLEANFILES+= $(ORIG_UNPAGED_OBJS)
CLEANFILES+= ${ORIG_UNPAGED_OBJS}
SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
do_iopenable.c do_readbios.c do_sdevio.c exception.c i8259.c io_inb.S \
@@ -40,6 +68,10 @@ SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c \
OBJS.kernel+= ${UNPAGED_OBJS}
.ifdef CONFIG_SMP
SRCS += arch_smp.c trampoline.S
.endif
.if ${USE_ACPI} != "no"
SRCS+= acpi.c
CPPFLAGS+= -DUSE_ACPI
@@ -59,25 +91,18 @@ SRCS+= arch_watchdog.c
CPPFLAGS+= -DUSE_WATCHDOG
.endif
sconst.h: procoffsets.h
apic_asm.S head.S klib16.S klib.S mpx.S: sconst.h
SRCS+= procoffsets.h
CPPFLAGS+=-I.
# It's OK to hardcode the arch as i386 here as this and procoffsets.cf
# are i386-specific.
TMP=procoffsets.h.tmp
INCLS=../include/arch/i386/include/
PROCOFFSETSCF=procoffsets.cf
procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h ${INCLS}/stackframe.h ${INCLS}/archtypes.h
.PATH: ${NETBSDSRCDIR}/include/arch/${MACHINE_ARCH}/include
procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h stackframe.h archtypes.h
${_MKTARGET_CREATE}
${TOOL_CAT} ${HERE}/${PROCOFFSETSCF} | \
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$TMP && \
mv -f $TMP $@
.ifdef CONFIG_SMP
SRCS += arch_smp.c trampoline.S
.endif
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$@.tmp && \
mv -f $@.tmp $@
sconst.h: procoffsets.h
apic_asm.S head.S klib16.S klib.S mpx.S: sconst.h

View File

@@ -10,14 +10,14 @@
#include "kernel/interrupt.h"
#include <minix/u64.h>
#include "glo.h"
#include "profile.h"
#include "kernel/profile.h"
#ifdef USE_APIC
#include "apic.h"
#endif
#include "spinlock.h"
#include "kernel/spinlock.h"
#ifdef CONFIG_SMP
#include "kernel/smp.h"

View File

@@ -1,5 +1,5 @@
#include "kernel.h"
#include "kernel/kernel.h"
#include <minix/minlib.h>
#include <minix/const.h>
#include <minix/cpufeature.h>

View File

@@ -3,7 +3,7 @@
/* sections */
#include <machine/vm.h>
#include "../../kernel.h"
#include "kernel/kernel.h"
#include <minix/config.h>
#include <minix/const.h>
#include <minix/com.h>

View File

@@ -17,7 +17,7 @@ void eoi_8259_slave(void);
* either
*/
#if defined(USE_APIC)
#include "arch/i386/apic.h"
#include "kernel/arch/i386/apic.h"
#define hw_intr_mask(irq) ioapic_mask_irq(irq)
#define hw_intr_unmask(irq) ioapic_unmask_irq(irq)

View File

@@ -33,4 +33,5 @@ SECTIONS
__k_unpaged__kern_size = . - _kern_vir_base;
_kern_size = __k_unpaged__kern_size;
}
_end = .;
}

View File

@@ -26,7 +26,7 @@
/* sections */
#include <machine/vm.h>
#include "../../kernel.h"
#include "kernel/kernel.h"
#include <minix/config.h>
#include <minix/const.h>
#include <minix/com.h>

View File

@@ -2,7 +2,7 @@
#include <minix/cpufeature.h>
#include <assert.h>
#include "kernel.h"
#include "kernel/kernel.h"
#include <libexec.h>
#include "arch_proto.h"

View File

@@ -1,7 +1,7 @@
#define UNPAGED 1 /* for proper kmain() prototype */
#include "kernel.h"
#include "kernel/kernel.h"
#include <assert.h>
#include <stdlib.h>
#include <minix/minlib.h>

View File

@@ -1,5 +1,5 @@
include "kernel.h"
include "kernel/kernel.h"
struct proc
member DIREG p_reg.di

View File

@@ -1,13 +1,8 @@
#ifndef __SCONST_H__
#define __SCONST_H__
/*
* LSC Weirdness going on with the const.h header: FIXME
#include "kernel/const.h"
#include "kernel/procoffsets.h"
*/
#include "const.h"
#include "procoffsets.h"
/*
* offset to current process pointer right after trap, we assume we always have

View File

@@ -1,4 +1,4 @@
#include "kernel.h"
#include "kernel/kernel.h"
#include "arch_proto.h"
struct minix_ipcvecs minix_ipcvecs_softint = {