Add MODULAR option. Include kernel linker stuff if MODULAR.

This commit is contained in:
ad 2008-01-06 18:03:58 +00:00
parent 9a2bbccfc7
commit 0805a9416a
10 changed files with 78 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: files.alpha,v 1.176 2007/11/28 17:40:03 ad Exp $
# $NetBSD: files.alpha,v 1.177 2008/01/06 18:04:00 ad Exp $
#
# alpha-specific configuration info
@ -412,6 +412,7 @@ file arch/alpha/alpha/clock.c
file arch/alpha/alpha/cpuconf.c
file arch/alpha/alpha/interrupt.c
file arch/alpha/alpha/ipifuncs.c multiprocessor
file arch/alpha/alpha/kobj_machdep.c modular
file arch/alpha/alpha/machdep.c
file arch/alpha/alpha/mainbus.c
file arch/alpha/alpha/mem.c

View File

@ -1,4 +1,4 @@
# $NetBSD: files.amd64,v 1.52 2007/12/26 16:28:17 joerg Exp $
# $NetBSD: files.amd64,v 1.53 2008/01/06 18:04:00 ad Exp $
#
# new style config file for amd64 architecture
#
@ -37,6 +37,7 @@ file arch/amd64/amd64/db_disasm.c ddb
file arch/amd64/amd64/db_interface.c ddb
file arch/amd64/amd64/db_memrw.c ddb | kgdb
file arch/amd64/amd64/db_trace.c ddb
file arch/amd64/amd64/kobj_machdep.c modular
file arch/amd64/amd64/kgdb_machdep.c kgdb
file kern/subr_disk_mbr.c disk
file arch/amd64/amd64/gdt.c

View File

@ -1,4 +1,4 @@
# $NetBSD: files.arm,v 1.86 2007/10/17 19:53:40 garbled Exp $
# $NetBSD: files.arm,v 1.87 2008/01/06 18:04:01 ad Exp $
# temporary define to allow easy moving to ../arch/arm/arm32
defflag ARM32
@ -138,6 +138,7 @@ file arch/arm/arm32/cpuswitch.S arm32
file arch/arm/arm32/exception.S arm32
file arch/arm/arm32/fault.c arm32
file arch/arm/arm32/fusu.S arm32
file arch/arm/arm32/kobj_machdep.c arm32 & modular
file arch/arm/arm32/mem.c arm32
file arch/arm/arm32/pmap.c arm32
file arch/arm/arm32/setcpsr.S arm32

View File

@ -1,4 +1,4 @@
# $NetBSD: files.i386,v 1.326 2007/12/26 16:28:15 joerg Exp $
# $NetBSD: files.i386,v 1.327 2008/01/06 18:03:59 ad Exp $
#
# new style config file for i386 architecture
#
@ -81,6 +81,7 @@ file arch/i386/i386/i386func.S
file arch/i386/i386/in_cksum.S inet | inet6
file arch/i386/i386/ipkdb_glue.c ipkdb
file arch/i386/i386/kgdb_machdep.c kgdb
file arch/i386/i386/kobj_machdep.c modular
file arch/i386/i386/machdep.c
file arch/i386/i386/identcpu.c
file arch/i386/i386/math_emulate.c math_emulate

View File

@ -1,4 +1,4 @@
# $NetBSD: files.m68k,v 1.42 2007/12/31 13:38:51 ad Exp $
# $NetBSD: files.m68k,v 1.43 2008/01/06 18:04:01 ad Exp $
#
defflag opt_fpsp.h FPSP
@ -13,6 +13,7 @@ file arch/m68k/m68k/db_trace.c ddb
file arch/m68k/m68k/in_cksum.c inet
file netinet/in4_cksum.c inet
file arch/m68k/m68k/kgdb_m68k.c kgdb
file arch/m68k/m68k/kobj_machdep.c modular
file arch/m68k/m68k/lock_stubs.s
file arch/m68k/m68k/m68k_machdep.c
file arch/m68k/m68k/mappedcopy.c mappedcopy

View File

@ -1,4 +1,4 @@
# $NetBSD: files.sh3,v 1.35 2007/10/17 19:57:06 garbled Exp $
# $NetBSD: files.sh3,v 1.36 2008/01/06 18:04:01 ad Exp $
#
defflag opt_cputype.h SH3 SH4
@ -13,6 +13,7 @@ file arch/sh3/sh3/db_trace.c ddb
file arch/sh3/sh3/in_cksum.S inet
file netinet/in4_cksum.c inet
file arch/sh3/sh3/kgdb_machdep.c kgdb
file arch/sh3/sh3/kobj_machdep.c modular
file arch/sh3/sh3/exception.c
file arch/sh3/sh3/exception_vector.S
file arch/sh3/sh3/locore_c.c

View File

@ -1,4 +1,4 @@
# $NetBSD: files.sparc,v 1.142 2007/10/17 19:57:11 garbled Exp $
# $NetBSD: files.sparc,v 1.143 2008/01/06 18:04:01 ad Exp $
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
# sparc-specific configuration info
@ -296,6 +296,7 @@ file arch/sparc/sparc/emul.c
file arch/sparc/sparc/in_cksum.c
file arch/sparc/sparc/intr.c
file arch/sparc/sparc/kgdb_machdep.c kgdb
file arch/sparc/sparc/kobj_machdep.c modular
# sparc/sparc/locore.s is handled specially in the makefile,
# because it must come first in the "ld" command line.
file arch/sparc/sparc/lock_stubs.s

View File

@ -1,4 +1,4 @@
# $NetBSD: files.sparc64,v 1.114 2007/11/19 03:26:04 macallan Exp $
# $NetBSD: files.sparc64,v 1.115 2008/01/06 18:04:02 ad Exp $
# @(#)files.sparc64 8.1 (Berkeley) 7/19/93
# sparc64-specific configuration info
@ -187,6 +187,7 @@ file arch/sparc64/sparc64/in_cksum.S
file arch/sparc64/sparc64/in4_cksum.c inet
file arch/sparc64/sparc64/intr.c
file arch/sparc64/sparc64/kgdb_machdep.c kgdb
file arch/sparc64/sparc64/kobj_machdep.c modular
# sparc/sparc/locore.s is handled specially in the makefile,
# because it must come first in the "ld" command line.
file arch/sparc64/sparc64/machdep.c

View File

@ -1,4 +1,4 @@
# $NetBSD: files,v 1.882 2008/01/01 21:28:38 yamt Exp $
# $NetBSD: files,v 1.883 2008/01/06 18:03:59 ad Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@ -24,6 +24,7 @@ defflag KTRACE
defflag MBUFTRACE
defflag PTRACE
defflag COREDUMP
defflag opt_modular.h MODULAR
defparam DEFCORENAME
defparam HZ
@ -1396,6 +1397,7 @@ file kern/subr_evcnt.c
file kern/subr_extent.c
file kern/subr_hash.c
file kern/subr_kmem.c
file kern/subr_kobj.c
file kern/subr_lockdebug.c
file kern/subr_log.c
file kern/subr_pool.c

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_kobj.c,v 1.4 2008/01/06 15:13:07 jmcneill Exp $ */
/* $NetBSD: subr_kobj.c,v 1.5 2008/01/06 18:03:58 ad Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -66,8 +66,10 @@
* TODO: adjust kmem_alloc() calls to avoid needless fragmentation.
*/
#include "opt_modular.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.4 2008/01/06 15:13:07 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.5 2008/01/06 18:03:58 ad Exp $");
#define ELFSIZE ARCH_ELFSIZE
@ -89,6 +91,8 @@ __KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.4 2008/01/06 15:13:07 jmcneill Exp $
#include <uvm/uvm_extern.h>
#ifdef MODULAR
typedef struct {
void *addr;
Elf_Off size;
@ -975,3 +979,56 @@ kobj_read(kobj_t ko, void *base, size_t size, off_t off)
return error;
}
#else /* MODULAR */
int
kobj_open_file(kobj_t *kop, const char *name, const char *filename)
{
return ENOSYS;
}
int
kobj_open_mem(kobj_t *kop, const char *name, void *base, ssize_t size)
{
return ENOSYS;
}
void
kobj_close(kobj_t ko)
{
panic("not modular");
}
int
kobj_load(kobj_t ko)
{
panic("not modular");
}
void
kobj_unload(kobj_t ko)
{
panic("not modular");
}
void
kobj_stat(kobj_t ko, vaddr_t *base, size_t *size, uintptr_t *entry)
{
panic("not modular");
}
void
kobj_set_name(kobj_t ko, const char *name)
{
panic("not modular");
}
#endif /* MODULAR */