-# $OpenBSD: Makefile.i386,v 1.17 1997/02/24 03:27:38 downsj Exp $
+# $OpenBSD: Makefile.i386,v 1.18 1997/03/29 07:12:04 tholo Exp $
# $NetBSD: Makefile.i386,v 1.67 1996/05/11 16:12:11 mycroft Exp $
# Makefile for OpenBSD
TOUCH?= touch
# source tree is located via $S relative to the compilation directory
-S= ../../../..
-I386= ../..
+.ifndef S
+S!= cd ../../../..; pwd
+.endif
+I386= $S/arch/i386
-INCLUDES= -I. -I$S/arch -I$S -nostdinc
+INCLUDES= -nostdinc -I. -I$S/arch -I$S
CPPFLAGS= ${INCLUDES} ${IDENT} -D_KERNEL -Di386
CDIAGFLAGS= -Werror -Wall -Wstrict-prototypes -Wno-uninitialized \
%LOAD
-assym.h: genassym
- ./genassym >assym.h
-
-genassym: genassym.o
- ${HOSTCC} -o $@ genassym.o
-
-genassym.o: ${I386}/i386/genassym.c
- ${HOSTED_C}
+assym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf
+ sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \
+ ${PARAM} < ${I386}/i386/genassym.cf > assym.h.tmp && \
+ mv -f assym.h.tmp assym.h
param.c: $S/conf/param.c
rm -f param.c
clean::
rm -f eddep *bsd bsd.gdb tags *.[io] [a-z]*.s \
- [Ee]rrs linterrs makelinks genassym genassym.o assym.h
+ [Ee]rrs linterrs makelinks assym.h
lint:
@lint -hbxncez -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
- ${MKDEP} -a ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} \
- ${I386}/i386/genassym.c
# depend on root or device configuration
tcp_subr.o tcp_timer.o tcp_output.o: Makefile
# depend on maxusers
-genassym.o machdep.o: Makefile
+machdep.o: Makefile
# depend on CPU configuration
locore.o machdep.o: Makefile
+++ /dev/null
-/* $NetBSD: genassym.c,v 1.49 1996/05/03 19:42:07 christos Exp $ */
-
-/*-
- * Copyright (c) 1995 Charles M. Hannum. All rights reserved.
- * Copyright (c) 1982, 1990 The Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * William Jolitz.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)genassym.c 5.11 (Berkeley) 5/10/91
- */
-
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/resourcevar.h>
-#include <sys/device.h>
-#include <sys/user.h>
-#ifdef INET
-#include <sys/mbuf.h>
-#endif
-
-#include <vm/vm.h>
-
-#include <machine/trap.h>
-#include <machine/pmap.h>
-#include <machine/vmparam.h>
-
-#include "apm.h"
-#if NAPM > 0
-#include <machine/apmvar.h>
-#endif
-
-#ifdef COMPAT_SVR4
-#include <compat/svr4/svr4_ucontext.h>
-#endif
-
-#ifdef COMPAT_LINUX
-#include <machine/linux_machdep.h>
-#endif
-
-#ifdef COMPAT_FREEBSD
-#include <machine/freebsd_machdep.h>
-#endif
-
-#include "isa.h"
-#if NISA > 0
-#include <i386/isa/isa_machdep.h>
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-
-int main __P((void));
-
-int
-main()
-{
-
-#define def(N,V) printf("#define\t%s %d\n", N, V)
-#define off(N,S,M) def(N, (int)offsetof(S, M))
-
- def("SRUN", SRUN);
-
- def("PTDPTDI", PTDPTDI);
- def("KPTDI", KPTDI);
- def("NKPDE", NKPDE);
- def("APTDPTDI", APTDPTDI);
-
- def("VM_MAXUSER_ADDRESS", (int)VM_MAXUSER_ADDRESS);
-
- off("P_ADDR", struct proc, p_addr);
- off("P_BACK", struct proc, p_back);
- off("P_FORW", struct proc, p_forw);
- off("P_PRIORITY", struct proc, p_priority);
- off("P_STAT", struct proc, p_stat);
- off("P_WCHAN", struct proc, p_wchan);
- off("P_VMSPACE", struct proc, p_vmspace);
- off("P_FLAG", struct proc, p_flag);
-
- def("P_SYSTEM", P_SYSTEM);
-
- off("V_TRAP", struct vmmeter, v_trap);
- off("V_INTR", struct vmmeter, v_intr);
-
- off("PCB_CR3", struct pcb, pcb_cr3);
- off("PCB_EBP", struct pcb, pcb_ebp);
- off("PCB_ESP", struct pcb, pcb_esp);
- off("PCB_FS", struct pcb, pcb_fs);
- off("PCB_GS", struct pcb, pcb_gs);
- off("PCB_CR0", struct pcb, pcb_cr0);
- off("PCB_LDT_SEL", struct pcb, pcb_ldt_sel);
- off("PCB_TSS_SEL", struct pcb, pcb_tss_sel);
- off("PCB_ONFAULT", struct pcb, pcb_onfault);
-
- off("TF_CS", struct trapframe, tf_cs);
- off("TF_TRAPNO", struct trapframe, tf_trapno);
- off("TF_EFLAGS", struct trapframe, tf_eflags);
-
- def("FRAMESIZE", sizeof(struct trapframe));
-
- off("SIGF_HANDLER", struct sigframe, sf_handler);
- off("SIGF_SC", struct sigframe, sf_sc);
- off("SC_FS", struct sigcontext, sc_fs);
- off("SC_GS", struct sigcontext, sc_gs);
- off("SC_EFLAGS", struct sigcontext, sc_eflags);
-
-#ifdef INET
- off("M_NEXT", struct mbuf, m_next);
- off("M_DATA", struct mbuf, m_data);
- off("M_LEN", struct mbuf, m_len);
-#endif
-
-#ifdef COMPAT_SVR4
- off("SVR4_SIGF_HANDLER", struct svr4_sigframe, sf_handler);
- off("SVR4_SIGF_UC", struct svr4_sigframe, sf_uc);
- off("SVR4_UC_FS", struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS]);
- off("SVR4_UC_GS", struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS]);
- off("SVR4_UC_EFLAGS", struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL]);
-#endif
-
-#ifdef COMPAT_LINUX
- off("LINUX_SIGF_HANDLER", struct linux_sigframe, sf_handler);
- off("LINUX_SIGF_SC", struct linux_sigframe, sf_sc);
- off("LINUX_SC_FS", struct linux_sigcontext, sc_fs);
- off("LINUX_SC_GS", struct linux_sigcontext, sc_gs);
- off("LINUX_SC_EFLAGS", struct linux_sigcontext, sc_eflags);
-#endif
-
-#ifdef COMPAT_FREEBSD
- off("FREEBSD_SIGF_HANDLER", struct freebsd_sigframe, sf_handler);
- off("FREEBSD_SIGF_SC", struct freebsd_sigframe, sf_sc);
-#endif
-
-#if NISA > 0
- off("IH_FUN", struct intrhand, ih_fun);
- off("IH_ARG", struct intrhand, ih_arg);
- off("IH_COUNT", struct intrhand, ih_count);
- off("IH_NEXT", struct intrhand, ih_next);
-#endif
-#if NAPM > 0
- off("APM_CODE32", struct apm_connect_info, apm_code32_seg_base);
- off("APM_CODE16", struct apm_connect_info, apm_code16_seg_base);
- off("APM_DATA", struct apm_connect_info, apm_data_seg_base);
- off("APM_CODE32_LEN", struct apm_connect_info, apm_code32_seg_len);
- off("APM_DATA_LEN", struct apm_connect_info, apm_data_seg_len);
- off("APM_ENTRY", struct apm_connect_info, apm_entrypt);
- off("APM_DETAIL", struct apm_connect_info, apm_detail);
- off("APM_CALL", struct apm_connect_info, apm_entrypt);
- def("APM_SIZE", sizeof(struct apm_connect_info));
- off("APMREG_AX", struct apmregs, ax);
- off("APMREG_BX", struct apmregs, bx);
- off("APMREG_CX", struct apmregs, cx);
- off("APMREG_DX", struct apmregs, dx);
-#endif
-
- exit(0);
-}
--- /dev/null
+# $OpenBSD: genassym.cf,v 1.1 1997/03/29 07:12:07 tholo Exp $
+#
+# Copyright (c) 1982, 1990 The Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by the University of
+# California, Berkeley and its contributors.
+# 4. Neither the name of the University nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# @(#)genassym.c 7.8 (Berkeley) 5/7/91
+#
+
+include <sys/param.h>
+include <sys/proc.h>
+include <sys/resourcevar.h>
+include <sys/device.h>
+include <sys/user.h>
+ifdef INET
+include <sys/mbuf.h>
+endif
+
+include <vm/vm.h>
+
+include <machine/trap.h>
+include <machine/pmap.h>
+include <machine/vmparam.h>
+
+include "apm.h"
+if NAPM > 0
+include <machine/apmvar.h>
+endif
+
+if COMPAT_SVR4 > 0
+include <compat/svr4/svr4_ucontext.h>
+endif
+
+if COMPAT_LINUX > 0
+include <machine/linux_machdep.h>
+endif
+
+if COMPAT_FREEBSD > 0
+include <machine/freebsd_machdep.h>
+endif
+
+include "isa.h"
+if NISA > 0
+include <i386/isa/isa_machdep.h>
+endif
+
+define SRUN SRUN
+
+# values for page tables
+define PTDPTDI PTDPTDI
+define KPTDI KPTDI
+define NKPDE NKPDE
+define APTDPTDI APTDPTDI
+
+# values for virtual memory
+define VM_MAXUSER_ADDRESS VM_MAXUSER_ADDRESS
+
+# proc fields and values
+define P_ADDR offsetof(struct proc, p_addr)
+define P_BACK offsetof(struct proc, p_back)
+define P_FORW offsetof(struct proc, p_forw)
+define P_PRIORITY offsetof(struct proc, p_priority)
+define P_STAT offsetof(struct proc, p_stat)
+define P_WCHAN offsetof(struct proc, p_wchan)
+define P_VMSPACE offsetof(struct proc, p_vmspace)
+define P_FLAG offsetof(struct proc, p_flag)
+
+define P_SYSTEM P_SYSTEM
+
+# interrupt/fault metering
+define V_TRAP offsetof(struct vmmeter, v_trap)
+define V_INTR offsetof(struct vmmeter, v_intr)
+
+# pcb fields
+define PCB_CR3 offsetof(struct pcb, pcb_cr3)
+define PCB_EBP offsetof(struct pcb, pcb_ebp)
+define PCB_ESP offsetof(struct pcb, pcb_esp)
+define PCB_FS offsetof(struct pcb, pcb_fs)
+define PCB_GS offsetof(struct pcb, pcb_gs)
+define PCB_CR0 offsetof(struct pcb, pcb_cr0)
+define PCB_LDT_SEL offsetof(struct pcb, pcb_ldt_sel)
+define PCB_TSS_SEL offsetof(struct pcb, pcb_tss_sel)
+define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
+
+# frame definitions
+define TF_CS offsetof(struct trapframe, tf_cs)
+define TF_TRAPNO offsetof(struct trapframe, tf_trapno)
+define TF_EFLAGS offsetof(struct trapframe, tf_eflags)
+
+define FRAMESIZE sizeof(struct trapframe)
+
+# signal handling
+define SIGF_HANDLER offsetof(struct sigframe, sf_handler)
+define SIGF_SC offsetof(struct sigframe, sf_sc)
+define SC_FS offsetof(struct sigcontext, sc_fs)
+define SC_GS offsetof(struct sigcontext, sc_gs)
+define SC_EFLAGS offsetof(struct sigcontext, sc_eflags)
+
+# mbuf fields
+ifdef INET
+define M_NEXT offsetof(struct mbuf, m_next)
+define M_DATA offsetof(struct mbuf, m_data)
+define M_LEN offsetof(struct mbuf, m_len)
+endif
+
+# SVR4 frame offsets
+ifdef COMPAT_SVR4
+define SVR4_SIGF_HANDLER offsetof(struct svr4_sigframe, sf_handler)
+define SVR4_SIGF_UC offsetof(struct svr4_sigframe, sf_uc)
+define SVR4_UC_FS offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_FS])
+define SVR4_UC_GS offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_GS])
+define SVR4_UC_EFLAGS offsetof(struct svr4_ucontext, uc_mcontext.greg[SVR4_X86_EFL])
+endif
+
+# Linux frame offsets
+ifdef COMPAT_LINUX
+define LINUX_SIGF_HANDLER offsetof(struct linux_sigframe, sf_handler)
+define LINUX_SIGF_SC offsetof(struct linux_sigframe, sf_sc)
+define LINUX_SC_FS offsetof(struct linux_sigcontext, sc_fs)
+define LINUX_SC_GS offsetof(struct linux_sigcontext, sc_gs)
+define LINUX_SC_EFLAGS offsetof(struct linux_sigcontext, sc_eflags)
+endif
+
+# FreeBSD frame offsets
+ifdef COMPAT_FREEBSD
+define FREEBSD_SIGF_HANDLER offsetof(struct freebsd_sigframe, sf_handler)
+define FREEBSD_SIGF_SC offsetof(struct freebsd_sigframe, sf_sc)
+endif
+
+# Interrupt metering
+if NISA > 0
+define IH_FUN offsetof(struct intrhand, ih_fun)
+define IH_ARG offsetof(struct intrhand, ih_arg)
+define IH_COUNT offsetof(struct intrhand, ih_count)
+define IH_NEXT offsetof(struct intrhand, ih_next)
+endif
+
+# Advanced Power Management information
+if NAPM > 0
+define APM_CODE32 offsetof(struct apm_connect_info, apm_code32_seg_base)
+define APM_CODE16 offsetof(struct apm_connect_info, apm_code16_seg_base)
+define APM_DATA offsetof(struct apm_connect_info, apm_data_seg_base)
+define APM_CODE32_LEN offsetof(struct apm_connect_info, apm_code32_seg_len)
+define APM_DATA_LEN offsetof(struct apm_connect_info, apm_data_seg_len)
+define APM_ENTRY offsetof(struct apm_connect_info, apm_entrypt)
+define APM_DETAIL offsetof(struct apm_connect_info, apm_detail)
+define APM_CALL offsetof(struct apm_connect_info, apm_entrypt)
+define APM_SIZE sizeof(struct apm_connect_info)
+define APMREG_AX offsetof(struct apmregs, ax)
+define APMREG_BX offsetof(struct apmregs, bx)
+define APMREG_CX offsetof(struct apmregs, cx)
+define APMREG_DX offsetof(struct apmregs, dx)
+endif