1 # Makefile for arch-dependent kernel code
4 HERE=${.CURDIR}/arch/${MACHINE_ARCH}
7 # objects we want unpaged from -lc
8 MINLIB_OBJS_UNPAGED= get_bp.o
9 get_bp.o: ${NETBSDSRCDIR}/minix/lib/libc/arch/arm/get_bp.S
11 # objects we want unpaged from -lsys
12 SYS_OBJS_UNPAGED=assert.o stacktrace.o
13 assert.o: ${NETBSDSRCDIR}/minix/lib/libsys/assert.c
14 stacktrace.o: ${NETBSDSRCDIR}/minix/lib/libsys/stacktrace.c
16 # objects we want unpaged from -lminc
17 MINC_OBJS_UNPAGED= atoi.o \
19 strcmp.o strcpy.o strlen.o strncmp.o \
20 memcpy.o memmove.o memset.o \
21 udivdi3.o umoddi3.o qdivrem.o
22 MINC_OBJS_UNPAGED+= __aeabi_ldiv0.o __aeabi_idiv0.o __aeabi_uldivmod.o divide.o divsi3.o udivsi3.o
23 atoi.o: ${NETBSDSRCDIR}/minix/lib/libminc/atoi.c
24 printf.o: ${NETBSDSRCDIR}/sys/lib/libsa/printf.c
25 subr_prf.o: ${NETBSDSRCDIR}/sys/lib/libsa/subr_prf.c
26 memcpy.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/memcpy.S
27 memmove.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/memmove.S
28 memset.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/memset.S
29 strlen.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strlen.S
30 strcpy.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strcpy.S
31 strcmp.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strcmp.S
33 #strcat.o: ${NETBSDSRCDIR}/common/lib/libc/string/strcat.c
34 __aeabi_idiv0.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/__aeabi_idiv0.c
35 __aeabi_ldiv0.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/__aeabi_ldiv0.c
36 __aeabi_uldivmod.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S
37 divide.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/divide.S
38 divsi3.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/divsi3.S
39 udivsi3.o: ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/udivsi3.S
41 # the following is required by pre_init.c
42 strncmp.o: ${NETBSDSRCDIR}/common/lib/libc/string/strncmp.c
44 # these are required by kprintn.o:
45 udivdi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/udivdi3.c
46 umoddi3.o: ${NETBSDSRCDIR}/common/lib/libc/quad/umoddi3.c
47 qdivrem.o: ${NETBSDSRCDIR}/common/lib/libc/quad/qdivrem.c
49 CPPFLAGS.__aeabi_idiv0.c+= -D_STANDALONE
50 CPPFLAGS.__aeabi_ldiv0.c+= -D_STANDALONE
52 # LSC: putchar and kputc have the same signature. A bit hackish.
53 CPPFLAGS.subr_prf.c+= -Dputchar=kputc
55 # Activate optional support, may be deactivated.
56 CPPFLAGS.subr_prf.c+= -DLIBSA_PRINTF_LONGLONG_SUPPORT -DLIBSA_PRINTF_WIDTH_SUPPORT
58 .include "bsp/ti/Makefile.inc"
60 # some object files we give a symbol prefix (or namespace) of __k_unpaged_
61 # that must live in their own unique namespace.
63 .for unpaged_obj in head.o pre_init.o direct_tty_utils.o \
64 pg_utils.o klib.o utility.o arch_reset.o \
65 ${MINLIB_OBJS_UNPAGED} ${MINC_OBJS_UNPAGED} ${SYS_OBJS_UNPAGED} ${BSP_OBJS_UNPAGED}
66 unpaged_${unpaged_obj}: ${unpaged_obj}
67 ${OBJCOPY} --prefix-symbols=__k_unpaged_ ${.OBJDIR}/${unpaged_obj} $@
68 UNPAGED_OBJS += unpaged_${unpaged_obj}
69 ORIG_UNPAGED_OBJS += ${unpaged_obj}
73 CLEANFILES+= ${ORIG_UNPAGED_OBJS}
75 SRCS+= mpx.S arch_clock.c arch_do_vmctl.c arch_system.c do_padconf.c \
76 exception.c hw_intr.c klib.S memory.c \
77 protect.c direct_tty_utils.c arch_reset.c \
78 pg_utils.c phys_copy.S phys_memset.S exc.S
80 OBJS.kernel+= ${UNPAGED_OBJS}
82 klib.o mpx.o head.o: procoffsets.h
86 PROCOFFSETSCF=procoffsets.cf
88 .PATH: ${NETBSDSRCDIR}/minix/include/arch/${MACHINE_ARCH}/include
90 procoffsets.h: ${PROCOFFSETSCF} kernel.h proc.h stackframe.h archtypes.h
92 ${TOOL_CAT} ${HERE}/${PROCOFFSETSCF} | \
93 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} >$@.tmp && \
96 sconst.h: procoffsets.h
97 apic_asm.o head.o klib.o mpx.o: sconst.h