From owner-p4-projects@FreeBSD.ORG Thu Jul 24 10:12:32 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA6F737B405; Thu, 24 Jul 2003 10:12:31 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A99537B401 for ; Thu, 24 Jul 2003 10:12:31 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B300943FA3 for ; Thu, 24 Jul 2003 10:12:30 -0700 (PDT) (envelope-from cvance@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h6OHCU0U027888 for ; Thu, 24 Jul 2003 10:12:30 -0700 (PDT) (envelope-from cvance@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h6OHCUpR027885 for perforce@freebsd.org; Thu, 24 Jul 2003 10:12:30 -0700 (PDT) Date: Thu, 24 Jul 2003 10:12:30 -0700 (PDT) Message-Id: <200307241712.h6OHCUpR027885@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cvance@nailabs.com using -f From: Chris Vance To: Perforce Change Reviews Subject: PERFORCE change 34947 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2003 17:12:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=34947 Change 34947 by cvance@cvance_osx_laptop on 2003/07/24 10:11:30 A bunch of small changes to get closer to having the Darwin kernel build and boot with the basic TrustedBSD framework in place. - Add support for strsep - Fix up condition variables by removing unsupported API calls wait_queue_empty() and wait_queue_is_queue() - Get sbuf support to compile: replace _KERNEL with KERNEL in ifdefs, fix up include file paths, change malloc macros, add M_SBUF to malloc types - Install _label.h with the rest of the system headers - Temporarily remove mbuf security labels, since it has binary compatibility issues Affected files ... .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/conf/files#5 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_condvar.c#3 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/subr_sbuf.c#2 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/libkern/strsep.c#1 add .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/Makefile#4 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/libkern.h#1 add .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/malloc.h#4 edit .. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mbuf.h#3 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/conf/files#5 (text+ko) ==== @@ -124,6 +124,7 @@ bsd/libkern/skpc.c standard bsd/libkern/inet_ntoa.c standard bsd/libkern/bcd.c standard +bsd/libkern/strsep.c standard bsd/vfs/vfs_bio.c standard bsd/vfs/vfs_cache.c standard ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/kern_condvar.c#3 (text+ko) ==== @@ -38,7 +38,6 @@ #include #include -#include void cv_init(struct cv *cvp, const char *desc) @@ -54,8 +53,14 @@ cv_destroy(struct cv *cvp) { +#if 0 + /* + * TBD/CDV this method is marked both + * __APPLE_API_PRIVATE and MACH_KERNEL_PRIVATE + */ if (!wait_queue_is_queue(cvp->cv_wait_queue)) panic("cv_destroy: !wait_queue_is_queue"); +#endif bzero(cvp, sizeof(*cvp)); } @@ -134,12 +139,19 @@ panic("cv_waitq_remove: not currently supported"); } +#if 0 int cv_waitq_empty(struct cv *cvp) { - return (queue_empty(cvp->cv_wait_queue)); + /* + * TBD/CDV wait_queue_empty() should probably be used, but + * it's marked both __APPLE_API_PRIVATE and MACH_KERNEL_PRIVATE + * + */ + return (wait_queue_empty(cvp->cv_wait_queue)); } +#endif const char * cv_wmesg(struct cv *cvp) ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/kern/subr_sbuf.c#2 (text+ko) ==== @@ -30,33 +30,36 @@ #include -#ifdef _KERNEL -#include +#ifdef KERNEL +/* #include */ #include #include #include #include -#include -#else /* _KERNEL */ +#include +#include +#else /* KERNEL */ #include #include #include #include #include -#endif /* _KERNEL */ +#endif /* KERNEL */ #include -#ifdef _KERNEL -MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); -#define SBMALLOC(size) malloc(size, M_SBUF, M_WAITOK) -#define SBFREE(buf) free(buf, M_SBUF) -#else /* _KERNEL */ +#ifdef KERNEL +/* MALLOC_DEFINE(M_SBUF, "sbuf", "string buffers"); */ +#define SBMALLOC(size) _MALLOC(size, M_SBUF, M_WAITOK) +#define SBFREE(buf) FREE(buf, M_SBUF) +#define va_copy(d,s) __builtin_va_copy((d),(s)) +#else /* KERNEL */ #define KASSERT(e, m) #define SBMALLOC(size) malloc(size) #define SBFREE(buf) free(buf) #define min(x,y) MIN(x,y) -#endif /* _KERNEL */ + +#endif /* KERNEL */ /* * Predicates @@ -82,7 +85,7 @@ /* * Debugging support */ -#if defined(_KERNEL) && defined(INVARIANTS) +#if defined(KERNEL) && defined(INVARIANTS) static void _assert_sbuf_integrity(const char *fun, struct sbuf *s) { @@ -103,10 +106,10 @@ } #define assert_sbuf_integrity(s) _assert_sbuf_integrity(__func__, (s)) #define assert_sbuf_state(s, i) _assert_sbuf_state(__func__, (s), (i)) -#else /* _KERNEL && INVARIANTS */ +#else /* KERNEL && INVARIANTS */ #define assert_sbuf_integrity(s) do { } while (0) #define assert_sbuf_state(s, i) do { } while (0) -#endif /* _KERNEL && INVARIANTS */ +#endif /* KERNEL && INVARIANTS */ static int sbuf_extendsize(int size) @@ -193,7 +196,7 @@ return (s); } -#ifdef _KERNEL +#ifdef KERNEL /* * Create an sbuf with uio data */ @@ -280,7 +283,7 @@ return (0); } -#ifdef _KERNEL +#ifdef KERNEL /* * Copy a byte string from userland into an sbuf. */ @@ -344,7 +347,7 @@ return (0); } -#ifdef _KERNEL +#ifdef KERNEL /* * Append a string from userland to an sbuf. */ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/Makefile#4 (text+ko) ==== @@ -20,7 +20,7 @@ EXPINC_SUBDIRS_I386 = \ DATAFILES = \ - appleapiopts.h \ + _label.h appleapiopts.h \ acct.h attr.h buf.h callout.h cdefs.h clist.h conf.h \ condvar.h \ dir.h dirent.h disk.h disklabel.h disktab.h dkstat.h dmap.h domain.h \ ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/malloc.h#4 (text+ko) ==== @@ -169,9 +169,9 @@ #define M_JNL_TR 92 /* Journaling: "struct transaction" */ #define M_MACPIPELABEL 93 #define M_MACTEMP 94 +#define M_SBUF 95 +#define M_LAST 96 /* Must be last type + 1 */ -#define M_LAST 95 /* Must be last type + 1 */ - /* Strings corresponding to types of memory */ /* Must be in synch with the #defines above */ #define INITKMEMNAMES { \ @@ -270,6 +270,7 @@ "Transaction", /* 92 M_JNL_TR */\ "macpipelabel", /* 93 M_MACPIPELABEL */\ "mactemp", /* 94 M_MACTEMP */\ + "sbuf", /* 95 M_SBUF */\ } struct kmemstats { ==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/sys/mbuf.h#3 (text+ko) ==== @@ -131,7 +131,7 @@ struct mbuf *aux; /* extra data buffer; ipsec/others */ void *reserved1; /* for future use */ void *reserved2; /* for future use */ - struct label label; /* MAC label for packet */ + /* struct label label; /* MAC label for packet */ };