misc/159654: 46 kernel headers use register_t but don't #include
<sys/types.h>
Robert Millan
rmh at debian.org
Wed Aug 10 19:20:09 UTC 2011
>Number: 159654
>Category: misc
>Synopsis: 46 kernel headers use register_t but don't #include <sys/types.h>
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 10 19:20:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Robert Millan
>Release: FreeBSD 8.1
>Organization:
>Environment:
GNU/kFreeBSD thorin 8.1-1-amd64 #0 Wed Aug 10 13:58:08 CEST 2011 x86_64 amd64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ GNU/kFreeBSD
>Description:
The following headers use register_t but don't #include <sys/types.h>:
arm/include/frame.h
arm/include/profile.h
arm/include/proc.h
powerpc/include/ucontext.h
powerpc/include/pcb.h
powerpc/include/spr.h
powerpc/include/reg.h
powerpc/include/_align.h
powerpc/include/profile.h
powerpc/include/pcpu.h
powerpc/include/pmap.h
powerpc/include/proc.h
sparc64/include/smp.h
sparc64/include/profile.h
sparc64/include/cpufunc.h
sparc64/include/proc.h
ia64/include/profile.h
ia64/include/proc.h
mips/include/sigframe.h
mips/include/ucontext.h
mips/include/pcb.h
mips/include/db_machdep.h
mips/include/reg.h
mips/include/frame.h
mips/include/proc.h
mips/include/trap.h
ofed/include/linux/sched.h
x86/include/_align.h
i386/include/sigframe.h
i386/include/apicvar.h
i386/include/profile.h
i386/include/cpufunc.h
i386/include/proc.h
amd64/include/pcb.h
amd64/include/reg.h
amd64/include/apicvar.h
amd64/include/frame.h
amd64/include/intr_machdep.h
amd64/include/profile.h
amd64/include/cpufunc.h
amd64/include/pcpu.h
amd64/include/proc.h
sys/sysproto.h
sys/sysent.h
sys/proc.h
sys/ktrace.h
>How-To-Repeat:
>Fix:
Please consider attached patch to add the missing #include.
Patch attached with submission follows:
Index: arm/include/frame.h
===================================================================
--- arm/include/frame.h (revision 224762)
+++ arm/include/frame.h (working copy)
@@ -52,6 +52,7 @@
#ifndef _LOCORE
#include <sys/signal.h>
+#include <sys/types.h>
#include <sys/ucontext.h>
Index: arm/include/profile.h
===================================================================
--- arm/include/profile.h (revision 224762)
+++ arm/include/profile.h (working copy)
@@ -37,6 +37,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
/*
* Config generates something to tell the compiler to align functions on 32
* byte boundaries. A strict alignment is good for keeping the tables small.
Index: arm/include/proc.h
===================================================================
--- arm/include/proc.h (revision 224762)
+++ arm/include/proc.h (working copy)
@@ -38,6 +38,7 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
#include <machine/utrap.h>
struct md_utrap {
Index: powerpc/include/ucontext.h
===================================================================
--- powerpc/include/ucontext.h (revision 224762)
+++ powerpc/include/ucontext.h (working copy)
@@ -35,6 +35,8 @@
#ifndef _MACHINE_UCONTEXT_H_
#define _MACHINE_UCONTEXT_H_
+#include <sys/types.h>
+
typedef struct __mcontext {
int mc_vers;
int mc_flags;
Index: powerpc/include/pcb.h
===================================================================
--- powerpc/include/pcb.h (revision 224762)
+++ powerpc/include/pcb.h (working copy)
@@ -35,6 +35,8 @@
#ifndef _MACHINE_PCB_H_
#define _MACHINE_PCB_H_
+#include <sys/types.h>
+
typedef register_t faultbuf[25];
struct pcb {
Index: powerpc/include/spr.h
===================================================================
--- powerpc/include/spr.h (revision 224762)
+++ powerpc/include/spr.h (working copy)
@@ -29,6 +29,8 @@
#ifndef _POWERPC_SPR_H_
#define _POWERPC_SPR_H_
+#include <sys/types.h>
+
#ifndef _LOCORE
#define mtspr(reg, val) \
__asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
Index: powerpc/include/reg.h
===================================================================
--- powerpc/include/reg.h (revision 224762)
+++ powerpc/include/reg.h (working copy)
@@ -4,6 +4,8 @@
#ifndef _POWERPC_REG_H_
#define _POWERPC_REG_H_
+#include <sys/types.h>
+
#if defined(_KERNEL) && !defined(KLD_MODULE) && !defined(_STANDALONE)
#include "opt_compat.h"
#endif
Index: powerpc/include/_align.h
===================================================================
--- powerpc/include/_align.h (revision 224762)
+++ powerpc/include/_align.h (working copy)
@@ -41,6 +41,8 @@
#ifndef _POWERPC_INCLUDE__ALIGN_H_
#define _POWERPC_INCLUDE__ALIGN_H_
+#include <sys/types.h>
+
/*
* Round p (pointer or byte index) up to a correctly-aligned value
* for all data types (int, long, ...). The result is unsigned int
Index: powerpc/include/profile.h
===================================================================
--- powerpc/include/profile.h (revision 224762)
+++ powerpc/include/profile.h (working copy)
@@ -32,6 +32,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
#define _MCOUNT_DECL void __mcount
#define FUNCTION_ALIGNMENT 4
Index: powerpc/include/pcpu.h
===================================================================
--- powerpc/include/pcpu.h (revision 224762)
+++ powerpc/include/pcpu.h (working copy)
@@ -30,6 +30,7 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
+#include <sys/types.h>
#include <machine/cpufunc.h>
#include <machine/slb.h>
#include <machine/tlb.h>
Index: powerpc/include/pmap.h
===================================================================
--- powerpc/include/pmap.h (revision 224762)
+++ powerpc/include/pmap.h (working copy)
@@ -66,6 +66,7 @@
#include <sys/queue.h>
#include <sys/tree.h>
+#include <sys/types.h>
#include <sys/_cpuset.h>
#include <sys/_lock.h>
#include <sys/_mutex.h>
Index: powerpc/include/proc.h
===================================================================
--- powerpc/include/proc.h (revision 224762)
+++ powerpc/include/proc.h (working copy)
@@ -35,6 +35,8 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
+
/*
* Machine-dependent part of the proc structure
*/
Index: sparc64/include/smp.h
===================================================================
--- sparc64/include/smp.h (revision 224762)
+++ sparc64/include/smp.h (working copy)
@@ -30,6 +30,8 @@
#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_
+#include <sys/types.h>
+
#ifdef SMP
#define CPU_TICKSYNC 1
Index: sparc64/include/profile.h
===================================================================
--- sparc64/include/profile.h (revision 224762)
+++ sparc64/include/profile.h (working copy)
@@ -32,6 +32,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
#if !defined(_KERNEL) && !defined(_SYS_CDEFS_H_)
#error this file needs sys/cdefs.h as a prerequisite
#endif
Index: sparc64/include/cpufunc.h
===================================================================
--- sparc64/include/cpufunc.h (revision 224762)
+++ sparc64/include/cpufunc.h (working copy)
@@ -29,6 +29,7 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
+#include <sys/types.h>
#include <machine/asi.h>
#include <machine/pstate.h>
Index: sparc64/include/proc.h
===================================================================
--- sparc64/include/proc.h (revision 224762)
+++ sparc64/include/proc.h (working copy)
@@ -34,6 +34,7 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
#include <machine/utrap.h>
struct md_utrap {
Index: ia64/include/profile.h
===================================================================
--- ia64/include/profile.h (revision 224762)
+++ ia64/include/profile.h (working copy)
@@ -29,6 +29,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
#define _MCOUNT_DECL void __mcount
#define MCOUNT
Index: ia64/include/proc.h
===================================================================
--- ia64/include/proc.h (revision 224762)
+++ ia64/include/proc.h (working copy)
@@ -29,6 +29,8 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
+
struct mdthread {
int md_spinlock_count; /* (k) */
int md_saved_intr; /* (k) */
Index: mips/include/sigframe.h
===================================================================
--- mips/include/sigframe.h (revision 224762)
+++ mips/include/sigframe.h (working copy)
@@ -32,6 +32,8 @@
#ifndef _MACHINE_SIGFRAME_H_
#define _MACHINE_SIGFRAME_H_
+#include <sys/types.h>
+
/*
* WARNING: code in locore.s assumes the layout shown for sf_signum
* thru sf_addr so... don't alter them!
Index: mips/include/ucontext.h
===================================================================
--- mips/include/ucontext.h (revision 224762)
+++ mips/include/ucontext.h (working copy)
@@ -37,6 +37,8 @@
#ifndef _MACHINE_UCONTEXT_H_
#define _MACHINE_UCONTEXT_H_
+#include <sys/types.h>
+
#ifndef _LOCORE
typedef struct __mcontext {
Index: mips/include/pcb.h
===================================================================
--- mips/include/pcb.h (revision 224762)
+++ mips/include/pcb.h (working copy)
@@ -42,6 +42,7 @@
#ifndef _MACHINE_PCB_H_
#define _MACHINE_PCB_H_
+#include <sys/types.h>
#include <machine/frame.h>
/*
Index: mips/include/db_machdep.h
===================================================================
--- mips/include/db_machdep.h (revision 224762)
+++ mips/include/db_machdep.h (working copy)
@@ -37,6 +37,7 @@
#ifndef _MIPS_DB_MACHDEP_H_
#define _MIPS_DB_MACHDEP_H_
+#include <sys/types.h>
#include <machine/frame.h>
#include <machine/trap.h>
#include <machine/endian.h>
Index: mips/include/reg.h
===================================================================
--- mips/include/reg.h (revision 224762)
+++ mips/include/reg.h (working copy)
@@ -42,6 +42,8 @@
#ifndef _MACHINE_REG_H_
#define _MACHINE_REG_H_
+#include <sys/types.h>
+
/*
* Location of the users' stored registers relative to ZERO.
* must be visible to assembly code.
Index: mips/include/frame.h
===================================================================
--- mips/include/frame.h (revision 224762)
+++ mips/include/frame.h (working copy)
@@ -37,6 +37,8 @@
#ifndef _MACHINE_FRAME_H_
#define _MACHINE_FRAME_H_
+#include <sys/types.h>
+
struct trapframe {
register_t zero;
register_t ast;
Index: mips/include/proc.h
===================================================================
--- mips/include/proc.h (revision 224762)
+++ mips/include/proc.h (working copy)
@@ -39,6 +39,8 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
+
/*
* Machine-dependent part of the proc structure.
*/
Index: mips/include/trap.h
===================================================================
--- mips/include/trap.h (revision 224762)
+++ mips/include/trap.h (working copy)
@@ -42,6 +42,8 @@
#ifndef _MACHINE_TRAP_H_
#define _MACHINE_TRAP_H_
+#include <sys/types.h>
+
/*
* Trap codes also known in trap.c for name strings.
* Used for indexing so modify with care.
Index: ofed/include/linux/sched.h
===================================================================
--- ofed/include/linux/sched.h (revision 224762)
+++ ofed/include/linux/sched.h (working copy)
@@ -33,6 +33,7 @@
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/sleepqueue.h>
+#include <sys/types.h>
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
Index: x86/include/_align.h
===================================================================
--- x86/include/_align.h (revision 224762)
+++ x86/include/_align.h (working copy)
@@ -41,6 +41,8 @@
#ifndef _X86_INCLUDE__ALIGN_H_
#define _X86_INCLUDE__ALIGN_H_
+#include <sys/types.h>
+
/*
* Round p (pointer or byte index) up to a correctly-aligned value
* for all data types (int, long, ...). The result is unsigned int
Index: i386/include/sigframe.h
===================================================================
--- i386/include/sigframe.h (revision 224762)
+++ i386/include/sigframe.h (working copy)
@@ -31,6 +31,8 @@
#ifndef _MACHINE_SIGFRAME_H_
#define _MACHINE_SIGFRAME_H_
+#include <sys/types.h>
+
/*
* Signal frames, arguments passed to application signal handlers.
*/
Index: i386/include/apicvar.h
===================================================================
--- i386/include/apicvar.h (revision 224762)
+++ i386/include/apicvar.h (working copy)
@@ -32,6 +32,8 @@
#ifndef _MACHINE_APICVAR_H_
#define _MACHINE_APICVAR_H_
+#include <sys/types.h>
+
/*
* Local && I/O APIC variable definitions.
*/
Index: i386/include/profile.h
===================================================================
--- i386/include/profile.h (revision 224762)
+++ i386/include/profile.h (working copy)
@@ -33,6 +33,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
Index: i386/include/cpufunc.h
===================================================================
--- i386/include/cpufunc.h (revision 224762)
+++ i386/include/cpufunc.h (working copy)
@@ -38,6 +38,8 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
+#include <sys/types.h>
+
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
Index: i386/include/proc.h
===================================================================
--- i386/include/proc.h (revision 224762)
+++ i386/include/proc.h (working copy)
@@ -33,6 +33,7 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
#include <machine/segments.h>
struct proc_ldt {
Index: amd64/include/pcb.h
===================================================================
--- amd64/include/pcb.h (revision 224762)
+++ amd64/include/pcb.h (working copy)
@@ -40,6 +40,7 @@
/*
* AMD64 process control block
*/
+#include <sys/types.h>
#include <machine/fpu.h>
#include <machine/segments.h>
Index: amd64/include/reg.h
===================================================================
--- amd64/include/reg.h (revision 224762)
+++ amd64/include/reg.h (working copy)
@@ -37,6 +37,8 @@
#ifndef _MACHINE_REG_H_
#define _MACHINE_REG_H_
+#include <sys/types.h>
+
#if defined(_KERNEL) && !defined(_STANDALONE)
#include "opt_compat.h"
#endif
Index: amd64/include/apicvar.h
===================================================================
--- amd64/include/apicvar.h (revision 224762)
+++ amd64/include/apicvar.h (working copy)
@@ -32,6 +32,7 @@
#ifndef _MACHINE_APICVAR_H_
#define _MACHINE_APICVAR_H_
+#include <sys/types.h>
#include <machine/segments.h>
/*
Index: amd64/include/frame.h
===================================================================
--- amd64/include/frame.h (revision 224762)
+++ amd64/include/frame.h (working copy)
@@ -37,6 +37,8 @@
#ifndef _MACHINE_FRAME_H_
#define _MACHINE_FRAME_H_ 1
+#include <sys/types.h>
+
/*
* System stack frames.
*/
Index: amd64/include/intr_machdep.h
===================================================================
--- amd64/include/intr_machdep.h (revision 224762)
+++ amd64/include/intr_machdep.h (working copy)
@@ -29,6 +29,8 @@
#ifndef __MACHINE_INTR_MACHDEP_H__
#define __MACHINE_INTR_MACHDEP_H__
+#include <sys/types.h>
+
#ifdef _KERNEL
/*
Index: amd64/include/profile.h
===================================================================
--- amd64/include/profile.h (revision 224762)
+++ amd64/include/profile.h (working copy)
@@ -33,6 +33,8 @@
#ifndef _MACHINE_PROFILE_H_
#define _MACHINE_PROFILE_H_
+#include <sys/types.h>
+
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
Index: amd64/include/cpufunc.h
===================================================================
--- amd64/include/cpufunc.h (revision 224762)
+++ amd64/include/cpufunc.h (working copy)
@@ -39,6 +39,8 @@
#ifndef _MACHINE_CPUFUNC_H_
#define _MACHINE_CPUFUNC_H_
+#include <sys/types.h>
+
#ifndef _SYS_CDEFS_H_
#error this file needs sys/cdefs.h as a prerequisite
#endif
Index: amd64/include/pcpu.h
===================================================================
--- amd64/include/pcpu.h (revision 224762)
+++ amd64/include/pcpu.h (working copy)
@@ -29,6 +29,8 @@
#ifndef _MACHINE_PCPU_H_
#define _MACHINE_PCPU_H_
+#include <sys/types.h>
+
#ifndef _SYS_CDEFS_H_
#error "sys/cdefs.h is a prerequisite for this file"
#endif
Index: amd64/include/proc.h
===================================================================
--- amd64/include/proc.h (revision 224762)
+++ amd64/include/proc.h (working copy)
@@ -33,6 +33,7 @@
#ifndef _MACHINE_PROC_H_
#define _MACHINE_PROC_H_
+#include <sys/types.h>
#include <machine/segments.h>
struct proc_ldt {
Index: sys/sysproto.h
===================================================================
--- sys/sysproto.h (revision 224762)
+++ sys/sysproto.h (working copy)
@@ -14,6 +14,7 @@
#include <sys/cpuset.h>
#include <sys/_semaphore.h>
#include <sys/ucontext.h>
+#include <sys/types.h>
#include <bsm/audit_kevents.h>
Index: sys/sysent.h
===================================================================
--- sys/sysent.h (revision 224762)
+++ sys/sysent.h (working copy)
@@ -33,6 +33,7 @@
#define _SYS_SYSENT_H_
#include <bsm/audit.h>
+#include <sys/types.h>
struct rlimit;
struct sysent;
Index: sys/proc.h
===================================================================
--- sys/proc.h (revision 224762)
+++ sys/proc.h (working copy)
@@ -61,6 +61,7 @@
#else
#include <sys/pcpu.h>
#endif
+#include <sys/types.h>
#include <sys/ucontext.h>
#include <sys/ucred.h>
#include <machine/proc.h> /* Machine-dependent proc substruct. */
Index: sys/ktrace.h
===================================================================
--- sys/ktrace.h (revision 224762)
+++ sys/ktrace.h (working copy)
@@ -33,6 +33,8 @@
#ifndef _SYS_KTRACE_H_
#define _SYS_KTRACE_H_
+#include <sys/types.h>
+
/*
* operations to ktrace system call (KTROP(op))
*/
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list