summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-10-27 11:45:49 +0000
committerphk <phk@FreeBSD.org>2000-10-27 11:45:49 +0000
commit54ca48450cf20c453a092aa95d086cd5c5751fcf (patch)
tree479cfa046c848adf9e8ada76b004eeda743154db /sys/i386
parentea5581599fd86937f5f773c8e66aedd6a3524383 (diff)
downloadFreeBSD-src-54ca48450cf20c453a092aa95d086cd5c5751fcf.zip
FreeBSD-src-54ca48450cf20c453a092aa95d086cd5c5751fcf.tar.gz
Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/conf/GENERIC.hints2
-rw-r--r--sys/i386/i386/machdep.c2
-rw-r--r--sys/i386/i386/tsc.c2
-rw-r--r--sys/i386/include/ansi.h5
-rw-r--r--sys/i386/isa/clock.c2
5 files changed, 8 insertions, 5 deletions
diff --git a/sys/i386/conf/GENERIC.hints b/sys/i386/conf/GENERIC.hints
index 652faa9..9603f4b 100644
--- a/sys/i386/conf/GENERIC.hints
+++ b/sys/i386/conf/GENERIC.hints
@@ -32,7 +32,7 @@ hint.npx.0.at="nexus"
hint.npx.0.port="0x0F0"
hint.npx.0.irq="13"
hint.apm.0.at="nexus"
-hint.apm.0.disabled="1"
+#hint.apm.0.disabled="1"
hint.apm.0.flags="0x20"
hint.pcic.0.at="isa"
# hint.pcic.0.irq="10" # Default to polling
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 62c698b..1d15d39 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -250,8 +250,6 @@ struct cpuhead cpuhead;
MUTEX_DECLARE(,sched_lock);
MUTEX_DECLARE(,Giant);
-#define offsetof(type, member) ((size_t)(&((type *)0)->member))
-
static void
cpu_startup(dummy)
void *dummy;
diff --git a/sys/i386/i386/tsc.c b/sys/i386/i386/tsc.c
index 1ad7bf4..8a84bf8 100644
--- a/sys/i386/i386/tsc.c
+++ b/sys/i386/i386/tsc.c
@@ -189,7 +189,7 @@ SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
static struct timecounter i8254_timecounter = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
- ~0u, /* counter_mask */
+ 0x1ffff, /* counter_mask */
0, /* frequency */
"i8254" /* name */
};
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index 65ab84f..f01fe5e 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -93,6 +93,11 @@
#define _BSD_CLOCKS_PER_SEC_ 128
/*
+ * We define this here since both <stddef.h> and <sys/types.h> needs it.
+ */
+#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
+
+/*
* Typedefs for especially magic types. #define's wouldn't work in the
* __GNUC__ case, since __attribute__(()) only works in certain contexts.
* This is not in <machine/types.h>, since that has too much namespace
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index 1ad7bf4..8a84bf8 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -189,7 +189,7 @@ SYSCTL_OPAQUE(_debug, OID_AUTO, tsc_timecounter, CTLFLAG_RD,
static struct timecounter i8254_timecounter = {
i8254_get_timecount, /* get_timecount */
0, /* no poll_pps */
- ~0u, /* counter_mask */
+ 0x1ffff, /* counter_mask */
0, /* frequency */
"i8254" /* name */
};
OpenPOWER on IntegriCloud