diff --git a/include/Makefile b/include/Makefile index 63021b6026d2..cca7b0b2467b 100644 --- a/include/Makefile +++ b/include/Makefile @@ -1,130 +1,132 @@ # From: @(#)Makefile 8.2 (Berkeley) 1/4/94 -# $Id: Makefile,v 1.75 1998/03/08 21:35:29 jb Exp $ +# $Id: Makefile,v 1.76 1998/03/28 11:48:14 dufault Exp $ # # Doing a make install builds /usr/include # # The ``rm -rf''s used below are safe because rm doesn't follow symbolic # links. # depend lint tags: CLEANFILES= osreldate.h version vers.c SUBDIR= rpcsvc FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \ dlfcn.h elf.h err.h fnmatch.h fstab.h \ fts.h glob.h grp.h strhash.h histedit.h \ kvm.h limits.h link.h locale.h malloc.h memory.h mpool.h \ ndbm.h netdb.h nl_types.h nlist.h \ paths.h pthread.h pthread_np.h pwd.h \ ranlib.h regex.h regexp.h resolv.h rune.h runetype.h setjmp.h sgtty.h \ signal.h stab.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h struct.h sysexits.h tar.h time.h timers.h ttyent.h unistd.h \ utime.h utmp.h vis.h .if defined(WANT_CSRG_LIBM) FILES+= math.h .endif ARPAFILES= ftp.h inet.h nameser.h telnet.h tftp.h PROTOFILES= dumprestore.h routed.h rwhod.h talkd.h timed.h RPCFILES= auth.h auth_unix.h clnt.h pmap_clnt.h pmap_prot.h pmap_rmt.h \ rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h types.h xdr.h \ auth_des.h des.h des_crypt.h MFILES= float.h floatingpoint.h stdarg.h varargs.h # posix4/aio.h conflicts with dysons and isn't installed: PFILES= mqueue.h sched.h semaphore.h \ # aio.h LFILES= errno.h fcntl.h poll.h syslog.h termios.h LDIRS= msdosfs net netns netatalk netinet netipx netkey nfs \ pccard posix4 sys vm \ # netccitt netiso LNOHEADERDIRS= isofs ufs LSUBDIRS= isofs/cd9660 ufs/ffs ufs/mfs ufs/ufs # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is # probably only useful for developers and should be avoided if you do not # wish to tie your /usr/include and /usr/src together. #SHARED= symlinks SHARED?= copies .if exists (${.CURDIR}/../sys/conf/newvers.sh) all: osreldate.h -osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh +osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh \ + ${.CURDIR}/../sys/sys/param.h @${ECHO} creating osreldate.h from newvers.sh + setvar PARAMFILE ${.CURDIR}/../sys/sys/param.h; \ . ${.CURDIR}/../sys/conf/newvers.sh; \ echo "$$COPYRIGHT" > osreldate.h; \ echo \#'undef __FreeBSD_version' >> osreldate.h; \ echo \#'define __FreeBSD_version' $$RELDATE >> osreldate.h .else all: @${ECHO} creating osreldate.h from sysctl info echo \#'undef __FreeBSD_version' > osreldate.h echo \#'define __FreeBSD_version '`sysctl -n kern.osreldate` \ >> osreldate.h .endif beforeinstall: ${SHARED} cd ${.CURDIR}; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${FILES} ${DESTDIR}/usr/include cd ${.CURDIR}/arpa; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${ARPAFILES} ${DESTDIR}/usr/include/arpa cd ${.CURDIR}/protocols; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${PROTOFILES} ${DESTDIR}/usr/include/protocols cd ${.CURDIR}/rpc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${RPCFILES} ${DESTDIR}/usr/include/rpc ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.OBJDIR}/osreldate.h \ ${DESTDIR}/usr/include .for i in ${LFILES} ln -sf sys/$i ${DESTDIR}/usr/include/$i .endfor .for i in ${MFILES} ln -sf machine/$i ${DESTDIR}/usr/include/$i .endfor .for i in ${PFILES} ln -sf posix4/$i ${DESTDIR}/usr/include/$i .endfor copies: .for i in ${LDIRS} ${LNOHEADERDIRS} machine if [ -h ${DESTDIR}/usr/include/$i ]; then \ rm -f ${DESTDIR}/usr/include/$i; \ fi .endfor mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .for i in ${LDIRS} ${LSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}/usr/include/$i .endfor .if exists(${.CURDIR}/../sys/${MACHINE}/include) cd ${.CURDIR}/../sys/${MACHINE}/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}/usr/include/machine .endif symlinks: @${ECHO} "Setting up symlinks to kernel source tree..." .for i in ${LDIRS} ${LNOHEADERDIRS} rm -rf ${DESTDIR}/usr/include/$i ln -s ../../sys/$i ${DESTDIR}/usr/include/$i .endfor rm -rf ${DESTDIR}/usr/include/machine ln -s ../../sys/${MACHINE}/include ${DESTDIR}/usr/include/machine .include diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386 index bd0d627421a1..ad464166f5e2 100644 --- a/sys/conf/Makefile.i386 +++ b/sys/conf/Makefile.i386 @@ -1,242 +1,242 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.111 1998/05/20 20:35:35 eivind Exp $ +# $Id: Makefile.i386,v 1.112 1998/05/20 20:54:04 eivind Exp $ # # Makefile for FreeBSD # # This makefile is constructed from a machine description: # config machineid # Most changes should be made in the machine description # /sys/i386/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # # Which version of config(8) is required. %VERSREQ= 300003 BINFORMAT?= aout #BINFORMAT?= aoutkld #BINFORMAT?= elf STD8X16FONT?= iso .if exists(./@/.) S= ./@ .else S= ../.. .endif I386= ${S}/i386 COPTFLAGS?=-O INCLUDES= -nostdinc -I- -I. -I$S # This hack is to allow kernel compiles to succeed on machines w/out srcdist .if exists($S/../include) INCLUDES+= -I$S/../include .else INCLUDES+= -I/usr/include .endif COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 DEFINED_PROF= ${PROF} .if defined(PROF) CFLAGS+= -malign-functions=4 .if ${PROFLEVEL} >= 2 IDENT+= -DGPROF4 -DGUPROF PROF+= -mprofiler-epilogue .endif .endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< # XXX LOCORE means "don't declare C stuff" not "for locore.s". NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< # ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally # omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which # is generated from all of ${OBJS}. We don't want to have to compile # everything just to do a make depend. SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} .if ${CFLAGS:M-g} == "" SYMORDER_EXCLUDE=-x symbols.exclude .endif SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET} .if ${BINFORMAT} == aout SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == aoutkld SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == elf SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ setdef1.o SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @size ${.TARGET} ; chmod 755 ${.TARGET} .endif %BEFORE_DEPEND %OBJS %CFILES %SFILES %LOAD %CLEAN clean: rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ # ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ # grep -v 'struct/union .* never defined' | \ # grep -v 'possible pointer alignment problem' symbols.exclude: Makefile echo "gcc2_compiled." >symbols.exclude echo "___gnu_compiled_c" >>symbols.exclude symbols.sort: ${I386}/i386/symbols.raw grep -v '^#' ${I386}/i386/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort locore.o: ${I386}/i386/locore.s assym.s ${NORMAL_S} setdef0.o: ${I386}/i386/setdef0.c setdefs.h ${NORMAL_C} setdef1.o: ${I386}/i386/setdef1.c setdefs.h ${NORMAL_C} setdefs.h: gensetdefs ${OBJS} ./gensetdefs ${OBJS} >setdefs.h gensetdefs: gensetdefs.o ${CC} ${CFLAGS} gensetdefs.o -o ${.TARGET} gensetdefs.o: ${I386}/i386/gensetdefs.c ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c # everything potentially depends on the Makefile since everything potentially # depends on the options. Some things are more dependent on the Makefile for # historical reasons. machdep.o: Makefile # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: Makefile # XXX - may no longer be needed locore.o: Makefile # depends on KDB (cons.o also depends on GENERIC) trap.o cons.o: Makefile # this rule stops ./assym.s in .depend from causing problems ./assym.s: assym.s assym.s: genassym ./genassym >assym.s # Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h opt_vm86.h ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c genassym: genassym.o ${CC} ${CFLAGS} ${PARAM} genassym.o -o ${.TARGET} ${OBJS}: opt_global.h # XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} rm -f .newdep mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend cleandepend: rm -f .depend links: egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ sort -u | comm -23 - dontlink | \ sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks sh makelinks && rm -f dontlink tags: @echo "see $S/kern/Makefile for tags" install: @if [ ! -f kernel ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if exists(${DESTDIR}/kernel) chflags noschg ${DESTDIR}/kernel mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h ${CC} -c ${CFLAGS} ioconf.c param.c: $S/conf/param.c -rm -f param.c cp $S/conf/param.c . param.o: param.c Makefile ${CC} -c ${CFLAGS} ${PARAM} param.c -vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} +vers.o: $S/sys/param.h ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} ${CC} ${CFLAGS} -c vers.c vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src .include %RULES # DO NOT DELETE THIS LINE -- make depend uses it diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc index bd0d627421a1..ad464166f5e2 100644 --- a/sys/conf/Makefile.powerpc +++ b/sys/conf/Makefile.powerpc @@ -1,242 +1,242 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.111 1998/05/20 20:35:35 eivind Exp $ +# $Id: Makefile.i386,v 1.112 1998/05/20 20:54:04 eivind Exp $ # # Makefile for FreeBSD # # This makefile is constructed from a machine description: # config machineid # Most changes should be made in the machine description # /sys/i386/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # # Which version of config(8) is required. %VERSREQ= 300003 BINFORMAT?= aout #BINFORMAT?= aoutkld #BINFORMAT?= elf STD8X16FONT?= iso .if exists(./@/.) S= ./@ .else S= ../.. .endif I386= ${S}/i386 COPTFLAGS?=-O INCLUDES= -nostdinc -I- -I. -I$S # This hack is to allow kernel compiles to succeed on machines w/out srcdist .if exists($S/../include) INCLUDES+= -I$S/../include .else INCLUDES+= -I/usr/include .endif COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 DEFINED_PROF= ${PROF} .if defined(PROF) CFLAGS+= -malign-functions=4 .if ${PROFLEVEL} >= 2 IDENT+= -DGPROF4 -DGUPROF PROF+= -mprofiler-epilogue .endif .endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< # XXX LOCORE means "don't declare C stuff" not "for locore.s". NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< # ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally # omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which # is generated from all of ${OBJS}. We don't want to have to compile # everything just to do a make depend. SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} .if ${CFLAGS:M-g} == "" SYMORDER_EXCLUDE=-x symbols.exclude .endif SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET} .if ${BINFORMAT} == aout SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == aoutkld SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == elf SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ setdef1.o SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @size ${.TARGET} ; chmod 755 ${.TARGET} .endif %BEFORE_DEPEND %OBJS %CFILES %SFILES %LOAD %CLEAN clean: rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ # ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ # grep -v 'struct/union .* never defined' | \ # grep -v 'possible pointer alignment problem' symbols.exclude: Makefile echo "gcc2_compiled." >symbols.exclude echo "___gnu_compiled_c" >>symbols.exclude symbols.sort: ${I386}/i386/symbols.raw grep -v '^#' ${I386}/i386/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort locore.o: ${I386}/i386/locore.s assym.s ${NORMAL_S} setdef0.o: ${I386}/i386/setdef0.c setdefs.h ${NORMAL_C} setdef1.o: ${I386}/i386/setdef1.c setdefs.h ${NORMAL_C} setdefs.h: gensetdefs ${OBJS} ./gensetdefs ${OBJS} >setdefs.h gensetdefs: gensetdefs.o ${CC} ${CFLAGS} gensetdefs.o -o ${.TARGET} gensetdefs.o: ${I386}/i386/gensetdefs.c ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c # everything potentially depends on the Makefile since everything potentially # depends on the options. Some things are more dependent on the Makefile for # historical reasons. machdep.o: Makefile # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: Makefile # XXX - may no longer be needed locore.o: Makefile # depends on KDB (cons.o also depends on GENERIC) trap.o cons.o: Makefile # this rule stops ./assym.s in .depend from causing problems ./assym.s: assym.s assym.s: genassym ./genassym >assym.s # Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h opt_vm86.h ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c genassym: genassym.o ${CC} ${CFLAGS} ${PARAM} genassym.o -o ${.TARGET} ${OBJS}: opt_global.h # XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} rm -f .newdep mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend cleandepend: rm -f .depend links: egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ sort -u | comm -23 - dontlink | \ sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks sh makelinks && rm -f dontlink tags: @echo "see $S/kern/Makefile for tags" install: @if [ ! -f kernel ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if exists(${DESTDIR}/kernel) chflags noschg ${DESTDIR}/kernel mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h ${CC} -c ${CFLAGS} ioconf.c param.c: $S/conf/param.c -rm -f param.c cp $S/conf/param.c . param.o: param.c Makefile ${CC} -c ${CFLAGS} ${PARAM} param.c -vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} +vers.o: $S/sys/param.h ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} ${CC} ${CFLAGS} -c vers.c vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src .include %RULES # DO NOT DELETE THIS LINE -- make depend uses it diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 689b1a94c599..6595cb78dcf9 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -1,95 +1,102 @@ #!/bin/sh - # # Copyright (c) 1984, 1986, 1990, 1993 # 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. # # @(#)newvers.sh 8.1 (Berkeley) 4/20/94 -# $Id: newvers.sh,v 1.35 1998/05/20 20:35:39 eivind Exp $ +# $Id: newvers.sh,v 1.36 1998/05/20 20:54:07 eivind Exp $ TYPE="FreeBSD" REVISION="3.0" BRANCH="CURRENT" RELEASE="${REVISION}-${BRANCH}" SNAPDATE="" if [ "X${SNAPDATE}" != "X" ]; then RELEASE="${RELEASE}-${SNAPDATE}" fi VERSION="${TYPE} ${RELEASE}" -RELDATE="300001" +if [ "X${PARAMFILE}" != "X" ]; then + RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ + ${PARAMFILE}) +else + RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' \ + $(dirname $0)/../sys/param.h) +fi + b=share/examples/etc/bsd-style-copyright year=`date '+%Y'` # look for copyright template for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b do if [ -r "$bsd_copyright" ]; then COPYRIGHT=`sed \ -e "s/\[year\]/$year/" \ -e 's/\[your name here\]\.* /FreeBSD Inc./' \ -e 's/\[your name\]\.*/FreeBSD Inc./' \ -e '/\[id for your version control system, if any\]/d' \ $bsd_copyright` break fi done # no copyright found, use a dummy if [ X"$COPYRIGHT" = X ]; then COPYRIGHT="/* * Copyright (c) $year * FreeBSD Inc. All rights reserved. * */" fi # add newline COPYRIGHT="$COPYRIGHT " LC_TIME=C; export LC_TIME if [ ! -r version ] then echo 0 > version fi touch version v=`cat version` u=${USER-root} d=`pwd` h=`hostname` t=`date` cat /dev/null > vers.c echo "$COPYRIGHT" >> vers.c echo "char ostype[] = \"${TYPE}\";" >> vers.c echo "char osrelease[] = \"${RELEASE}\";" >> vers.c echo "int osreldate = ${RELDATE};" >> vers.c echo "char sccs[4] = { '@', '(', '#', ')' };" >>vers.c echo "char version[] = \ \"${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n\";" >>vers.c echo `expr ${v} + 1` > version diff --git a/sys/i386/conf/Makefile.i386 b/sys/i386/conf/Makefile.i386 index bd0d627421a1..ad464166f5e2 100644 --- a/sys/i386/conf/Makefile.i386 +++ b/sys/i386/conf/Makefile.i386 @@ -1,242 +1,242 @@ # Makefile.i386 -- with config changes. # Copyright 1990 W. Jolitz # from: @(#)Makefile.i386 7.1 5/10/91 -# $Id: Makefile.i386,v 1.111 1998/05/20 20:35:35 eivind Exp $ +# $Id: Makefile.i386,v 1.112 1998/05/20 20:54:04 eivind Exp $ # # Makefile for FreeBSD # # This makefile is constructed from a machine description: # config machineid # Most changes should be made in the machine description # /sys/i386/conf/``machineid'' # after which you should do # config machineid # Generic makefile changes should be made in # /sys/i386/conf/Makefile.i386 # after which config should be rerun for all machines. # # Which version of config(8) is required. %VERSREQ= 300003 BINFORMAT?= aout #BINFORMAT?= aoutkld #BINFORMAT?= elf STD8X16FONT?= iso .if exists(./@/.) S= ./@ .else S= ../.. .endif I386= ${S}/i386 COPTFLAGS?=-O INCLUDES= -nostdinc -I- -I. -I$S # This hack is to allow kernel compiles to succeed on machines w/out srcdist .if exists($S/../include) INCLUDES+= -I$S/../include .else INCLUDES+= -I/usr/include .endif COPTS= ${INCLUDES} ${IDENT} -DKERNEL -include opt_global.h CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} LOAD_ADDRESS?= F0100000 DEFINED_PROF= ${PROF} .if defined(PROF) CFLAGS+= -malign-functions=4 .if ${PROFLEVEL} >= 2 IDENT+= -DGPROF4 -DGUPROF PROF+= -mprofiler-epilogue .endif .endif NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< # XXX LOCORE means "don't declare C stuff" not "for locore.s". NORMAL_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $< PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $< # ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally # omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which # is generated from all of ${OBJS}. We don't want to have to compile # everything just to do a make depend. SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c SYSTEM_SFILES= ${I386}/i386/locore.s SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS} .if ${CFLAGS:M-g} == "" SYMORDER_EXCLUDE=-x symbols.exclude .endif SYSTEM_LD_HEAD= @echo loading ${.TARGET}; rm -f ${.TARGET} .if ${BINFORMAT} == aout SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == aoutkld SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o SYSTEM_LD= @${LD} -Bforcedynamic -Z -T ${LOAD_ADDRESS} -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @echo rearranging symbols; \ symorder -m ${SYMORDER_EXCLUDE} symbols.sort ${.TARGET}; \ size ${.TARGET} ; chmod 755 ${.TARGET} .endif .if ${BINFORMAT} == elf SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \ setdef1.o SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @size ${.TARGET} ; chmod 755 ${.TARGET} .endif %BEFORE_DEPEND %OBJS %CFILES %SFILES %LOAD %CLEAN clean: rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \ vers.c vnode_if.c vnode_if.h ${CLEAN} #lint: /tmp param.c # @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} \ # ${I386}/i386/Locore.c ${CFILES} ioconf.c param.c | \ # grep -v 'struct/union .* never defined' | \ # grep -v 'possible pointer alignment problem' symbols.exclude: Makefile echo "gcc2_compiled." >symbols.exclude echo "___gnu_compiled_c" >>symbols.exclude symbols.sort: ${I386}/i386/symbols.raw grep -v '^#' ${I386}/i386/symbols.raw \ | sed 's/^ //' | sort -u > symbols.sort locore.o: ${I386}/i386/locore.s assym.s ${NORMAL_S} setdef0.o: ${I386}/i386/setdef0.c setdefs.h ${NORMAL_C} setdef1.o: ${I386}/i386/setdef1.c setdefs.h ${NORMAL_C} setdefs.h: gensetdefs ${OBJS} ./gensetdefs ${OBJS} >setdefs.h gensetdefs: gensetdefs.o ${CC} ${CFLAGS} gensetdefs.o -o ${.TARGET} gensetdefs.o: ${I386}/i386/gensetdefs.c ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.c # everything potentially depends on the Makefile since everything potentially # depends on the options. Some things are more dependent on the Makefile for # historical reasons. machdep.o: Makefile # the following is necessary because autoconf.o depends on #if GENERIC autoconf.o: Makefile # XXX - may no longer be needed locore.o: Makefile # depends on KDB (cons.o also depends on GENERIC) trap.o cons.o: Makefile # this rule stops ./assym.s in .depend from causing problems ./assym.s: assym.s assym.s: genassym ./genassym >assym.s # Some of the defines that genassym outputs may well depend on the # value of kernel options. genassym.o: ${I386}/i386/genassym.c Makefile opt_global.h opt_vm86.h ${CC} -c ${CFLAGS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c genassym: genassym.o ${CC} ${CFLAGS} ${PARAM} genassym.o -o ${.TARGET} ${OBJS}: opt_global.h # XXX this assumes that the options for NORMAL_C* and DRIVER_C* are identical. depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND} rm -f .newdep mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES} mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \ mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES} rm -f .depend mv -f .newdep .depend cleandepend: rm -f .depend links: egrep '#if' ${CFILES:Nswapkernel.c} | sed -f $S/conf/defines | \ sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink echo ${CFILES:Nswapkernel.c} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ sort -u | comm -23 - dontlink | \ sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks sh makelinks && rm -f dontlink tags: @echo "see $S/kern/Makefile for tags" install: @if [ ! -f kernel ] ; then \ echo "You must first build your kernel before trying to install." ; \ exit 1 ; \ fi .if exists(${DESTDIR}/kernel) chflags noschg ${DESTDIR}/kernel mv ${DESTDIR}/kernel ${DESTDIR}/kernel.old .endif PATH=$${PATH}:/sbin:/usr/sbin; \ if [ `sysctl -n kern.bootfile` = ${DESTDIR}/kernel ] ; then \ sysctl -w kern.bootfile=${DESTDIR}/kernel.old ; \ if [ -f /var/db/kvm_kernel.db ] ; then \ mv -f /var/db/kvm_kernel.db /var/db/kvm_kernel.old.db ; \ fi \ fi install -c -m 555 -o root -g wheel -fschg kernel ${DESTDIR}/ ioconf.o: ioconf.c $S/sys/param.h $S/sys/buf.h \ ${I386}/isa/isa_device.h ${I386}/isa/isa.h ${I386}/isa/icu.h ${CC} -c ${CFLAGS} ioconf.c param.c: $S/conf/param.c -rm -f param.c cp $S/conf/param.c . param.o: param.c Makefile ${CC} -c ${CFLAGS} ${PARAM} param.c -vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} +vers.o: $S/sys/param.h ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} ${CC} ${CFLAGS} -c vers.c vnode_if.c: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src sh $S/kern/vnode_if.sh $S/kern/vnode_if.src .include %RULES # DO NOT DELETE THIS LINE -- make depend uses it diff --git a/sys/sys/param.h b/sys/sys/param.h index 37e372d0abc8..9642efcc5170 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -1,224 +1,226 @@ /*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * 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. * * @(#)param.h 8.3 (Berkeley) 4/4/95 - * $Id: param.h,v 1.29 1998/05/20 20:35:42 eivind Exp $ + * $Id: param.h,v 1.30 1998/05/20 20:54:10 eivind Exp $ */ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ #define BSD 199506 /* System version (year & month). */ #define BSD4_3 1 #define BSD4_4 1 +#undef __FreeBSD_version +#define __FreeBSD_version 300001 /* Master version, propagated to newvers */ #ifndef NULL #define NULL 0 #endif #ifndef LOCORE #include #endif /* * Machine-independent constants (some used in following include files). * Redefined constants are from POSIX 1003.1 limits file. * * MAXCOMLEN should be >= sizeof(ac_comm) (see ) * MAXLOGNAME should be == UT_NAMESIZE+1 (see ) */ #include #define MAXCOMLEN 16 /* max command name remembered */ #define MAXINTERP 32 /* max interpreter file name length */ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ #define NGROUPS NGROUPS_MAX /* max number groups */ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ /* More types and definitions used throughout the kernel. */ #ifdef KERNEL #include #include #include #define FALSE 0 #define TRUE 1 #endif #ifndef KERNEL /* Signals. */ #include #endif /* Machine type dependent parameters. */ #include #ifndef KERNEL #include #endif /* * Priorities. Note that with 32 run queues, differences less than 4 are * insignificant. */ #define PSWP 0 #define PVM 4 #define PINOD 8 #define PRIBIO 16 #define PVFS 20 #define PZERO 22 /* No longer magic, shouldn't be here. XXX */ #define PSOCK 24 #define PWAIT 32 #define PCONFIG 32 #define PLOCK 36 #define PPAUSE 40 #define PUSER 50 #define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */ #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define NZERO 0 /* default "nice" */ #define NBPW sizeof(int) /* number of bytes per word (integer) */ #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ #define NODEV (dev_t)(-1) /* non-existent device */ /* * Clustering of hardware pages on machines with ridiculously small * page sizes is done here. The paging subsystem deals with units of * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each. */ #if 0 #define CLBYTES (CLSIZE*PAGE_SIZE) #endif #define CBLOCK 128 /* Clist block size, must be a power of 2. */ #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ /* Data chars/clist. */ #define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) #define CROUND (CBLOCK - 1) /* Clist rounding. */ /* * File system parameters and macros. * * The file system is made out of blocks of at most MAXBSIZE units, with * smaller units (fragments) only in the last direct block. MAXBSIZE * primarily determines the size of buffers in the buffer pool. It may be * made larger without any effect on existing file systems; however making * it smaller make make some file systems unmountable. Also, MAXBSIZE * must be less than MAXPHYS!!! DFLTBSIZE is the average amount of * memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount * of kernel virtual space allocated per nbuf. BKVASIZE should be >= * DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then * kva fragmentation causes fewer performance problems. */ #define MAXBSIZE 65536 #define BKVASIZE 8192 #define DFLTBSIZE 4096 #define MAXFRAG 8 /* * MAXPATHLEN defines the longest permissible path length after expanding * symbolic links. It is used to allocate a temporary buffer from the buffer * pool in which to do the name expansion, hence should be a power of two, * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the * maximum number of symbolic links that may be expanded in a path name. * It should be set high enough to allow all legitimate uses, but halt * infinite loops reasonably quickly. */ #define MAXPATHLEN PATH_MAX #define MAXSYMLINKS 32 /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ #ifndef KERNEL #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* * Constants for setting the parameters of the kernel memory allocator. * * 2 ** MINBUCKET is the smallest unit of memory that will be * allocated. It must be at least large enough to hold a pointer. * * Units of memory less or equal to MAXALLOCSAVE will permanently * allocate physical memory; requests for these size pieces of * memory are quite fast. Allocations greater than MAXALLOCSAVE must * always allocate and free physical memory; requests for these * size allocations should be done infrequently as they will be slow. * * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and * MAXALLOCSIZE must be a power of two. */ #define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ #define MAXALLOCSAVE (2 * PAGE_SIZE) /* * Scale factor for scaled integers used to count %cpu time and load avgs. * * The number of CPU `tick's that map to a unique `%age' can be expressed * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that * can be calculated (assuming 32 bits) can be closely approximated using * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). * * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. */ #define FSHIFT 11 /* bits to right of fixed binary point */ #define FSCALE (1<