Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/systm.h
| Show All 39 Lines | |||||
| #include <machine/atomic.h> | #include <machine/atomic.h> | ||||
| #include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
| #include <sys/callout.h> | #include <sys/callout.h> | ||||
| #include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
| #include <sys/queue.h> | #include <sys/queue.h> | ||||
| #include <sys/stdint.h> /* for people using printf mainly */ | #include <sys/stdint.h> /* for people using printf mainly */ | ||||
| #if defined(__clang__) | |||||
| #pragma clang diagnostic push | |||||
| #pragma clang diagnostic ignored "-Wnullability-completeness" | |||||
| #endif | |||||
| extern int cold; /* nonzero if we are doing a cold boot */ | extern int cold; /* nonzero if we are doing a cold boot */ | ||||
| extern int suspend_blocked; /* block suspend due to pending shutdown */ | extern int suspend_blocked; /* block suspend due to pending shutdown */ | ||||
| extern int rebooting; /* kern_reboot() has been called. */ | extern int rebooting; /* kern_reboot() has been called. */ | ||||
| extern const char *panicstr; /* panic message */ | extern const char *panicstr; /* panic message */ | ||||
| extern char version[]; /* system version */ | extern char version[]; /* system version */ | ||||
| extern char compiler_version[]; /* compiler version */ | extern char compiler_version[]; /* compiler version */ | ||||
| extern char copyright[]; /* system copyright */ | extern char copyright[]; /* system copyright */ | ||||
| extern int kstack_pages; /* number of kernel stack pages */ | extern int kstack_pages; /* number of kernel stack pages */ | ||||
| ▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
| int uprintf(const char *, ...) __printflike(1, 2); | int uprintf(const char *, ...) __printflike(1, 2); | ||||
| int vprintf(const char *, __va_list) __printflike(1, 0); | int vprintf(const char *, __va_list) __printflike(1, 0); | ||||
| int vasprintf(char **ret, struct malloc_type *mtp, const char *format, | int vasprintf(char **ret, struct malloc_type *mtp, const char *format, | ||||
| __va_list ap) __printflike(3, 0); | __va_list ap) __printflike(3, 0); | ||||
| int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); | int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); | ||||
| int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0); | int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0); | ||||
| int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); | int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); | ||||
| int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); | int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); | ||||
| int sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2) __scanflike(2, 3); | int sscanf(const char *, char const * _Nonnull, ...) __scanflike(2, 3); | ||||
| int vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2) __scanflike(2, 0); | int vsscanf(const char * _Nonnull, char const * _Nonnull, __va_list) __scanflike(2, 0); | ||||
| long strtol(const char *, char **, int) __nonnull(1); | long strtol(const char *, char **, int); | ||||
| u_long strtoul(const char *, char **, int) __nonnull(1); | u_long strtoul(const char *, char **, int); | ||||
| quad_t strtoq(const char *, char **, int) __nonnull(1); | quad_t strtoq(const char *, char **, int); | ||||
| u_quad_t strtouq(const char *, char **, int) __nonnull(1); | u_quad_t strtouq(const char *, char **, int); | ||||
| void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4); | void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4); | ||||
| void vtprintf(struct proc *, int, const char *, __va_list) __printflike(3, 0); | void vtprintf(struct proc *, int, const char *, __va_list) __printflike(3, 0); | ||||
| void hexdump(const void *ptr, int length, const char *hdr, int flags); | void hexdump(const void *ptr, int length, const char *hdr, int flags); | ||||
| #define HD_COLUMN_MASK 0xff | #define HD_COLUMN_MASK 0xff | ||||
| #define HD_DELIM_MASK 0xff00 | #define HD_DELIM_MASK 0xff00 | ||||
| #define HD_OMIT_COUNT (1 << 16) | #define HD_OMIT_COUNT (1 << 16) | ||||
| #define HD_OMIT_HEX (1 << 17) | #define HD_OMIT_HEX (1 << 17) | ||||
| #define HD_OMIT_CHARS (1 << 18) | #define HD_OMIT_CHARS (1 << 18) | ||||
| #define ovbcopy(f, t, l) bcopy((f), (t), (l)) | #define ovbcopy(f, t, l) bcopy((f), (t), (l)) | ||||
| void bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2); | void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len); | ||||
| void bzero(void *buf, size_t len) __nonnull(1); | void bzero(void * _Nonnull buf, size_t len); | ||||
| void explicit_bzero(void *, size_t) __nonnull(1); | void explicit_bzero(void * _Nonnull, size_t); | ||||
| void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2); | void *memcpy(void * _Nonnull to, const void * _Nonnull from, size_t len); | ||||
| void *memmove(void *dest, const void *src, size_t n) __nonnull(1) __nonnull(2); | void *memmove(void * _Nonnull dest, const void * _Nonnull src, size_t n); | ||||
| int copystr(const void * __restrict kfaddr, void * __restrict kdaddr, | int copystr(const void * _Nonnull __restrict kfaddr, | ||||
| size_t len, size_t * __restrict lencopied) | void * _Nonnull __restrict kdaddr, size_t len, | ||||
| __nonnull(1) __nonnull(2); | size_t * __restrict lencopied); | ||||
| int copyinstr(const void * __restrict udaddr, void * __restrict kaddr, | int copyinstr(const void * __restrict udaddr, | ||||
kib: Why do you disable user address 0 ? | |||||
Done Inline ActionsThis was my error, thanks. pfg: This was my error, thanks. | |||||
Done Inline ActionsActually ... it was not my error: __nonnull(1) __nonnull(2); translate into _Nonnull for the first and second arguments. pfg: Actually ... it was not my error: `__nonnull(1) __nonnull(2);` translate into `_Nonnull` for… | |||||
| size_t len, size_t * __restrict lencopied) | void * _Nonnull __restrict kaddr, size_t len, | ||||
| __nonnull(1) __nonnull(2); | size_t * __restrict lencopied); | ||||
| int copyin(const void * __restrict udaddr, void * __restrict kaddr, | int copyin(const void * _Nonnull __restrict udaddr, | ||||
| size_t len) __nonnull(1) __nonnull(2); | void * _Nonnull __restrict kaddr, size_t len); | ||||
| int copyin_nofault(const void * __restrict udaddr, void * __restrict kaddr, | int copyin_nofault(const void * _Nonnull __restrict udaddr, | ||||
| size_t len) __nonnull(1) __nonnull(2); | void * _Nonnull __restrict kaddr, size_t len); | ||||
| int copyout(const void * __restrict kaddr, void * __restrict udaddr, | int copyout(const void * _Nonnull __restrict kaddr, | ||||
| size_t len) __nonnull(1) __nonnull(2); | void * _Nonnull __restrict udaddr, size_t len); | ||||
| int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr, | int copyout_nofault(const void * _Nonnull __restrict kaddr, | ||||
| size_t len) __nonnull(1) __nonnull(2); | void * _Nonnull __restrict udaddr, size_t len); | ||||
| int fubyte(volatile const void *base); | int fubyte(volatile const void *base); | ||||
| long fuword(volatile const void *base); | long fuword(volatile const void *base); | ||||
| int fuword16(volatile const void *base); | int fuword16(volatile const void *base); | ||||
| int32_t fuword32(volatile const void *base); | int32_t fuword32(volatile const void *base); | ||||
| int64_t fuword64(volatile const void *base); | int64_t fuword64(volatile const void *base); | ||||
| int fueword(volatile const void *base, long *val); | int fueword(volatile const void *base, long *val); | ||||
| int fueword32(volatile const void *base, int32_t *val); | int fueword32(volatile const void *base, int32_t *val); | ||||
| ▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
| static __inline intrmask_t splnet(void) { return 0; } | static __inline intrmask_t splnet(void) { return 0; } | ||||
| static __inline intrmask_t spltty(void) { return 0; } | static __inline intrmask_t spltty(void) { return 0; } | ||||
| static __inline void splx(intrmask_t ipl __unused) { return; } | static __inline void splx(intrmask_t ipl __unused) { return; } | ||||
| /* | /* | ||||
| * Common `proc' functions are declared here so that proc.h can be included | * Common `proc' functions are declared here so that proc.h can be included | ||||
| * less often. | * less often. | ||||
| */ | */ | ||||
| int _sleep(void *chan, struct lock_object *lock, int pri, const char *wmesg, | int _sleep(void * _Nonnull chan, struct lock_object *lock, int pri, | ||||
| sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); | const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags); | ||||
| #define msleep(chan, mtx, pri, wmesg, timo) \ | #define msleep(chan, mtx, pri, wmesg, timo) \ | ||||
| _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ | _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \ | ||||
| tick_sbt * (timo), 0, C_HARDCLOCK) | tick_sbt * (timo), 0, C_HARDCLOCK) | ||||
| #define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \ | #define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \ | ||||
| _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \ | _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \ | ||||
| (flags)) | (flags)) | ||||
| int msleep_spin_sbt(void *chan, struct mtx *mtx, const char *wmesg, | int msleep_spin_sbt(void * _Nonnull chan, struct mtx *mtx, | ||||
| sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1); | const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags); | ||||
| #define msleep_spin(chan, mtx, wmesg, timo) \ | #define msleep_spin(chan, mtx, wmesg, timo) \ | ||||
| msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \ | msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \ | ||||
| 0, C_HARDCLOCK) | 0, C_HARDCLOCK) | ||||
| int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, | int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr, | ||||
| int flags); | int flags); | ||||
| #define pause(wmesg, timo) \ | #define pause(wmesg, timo) \ | ||||
| pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) | pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK) | ||||
| #define tsleep(chan, pri, wmesg, timo) \ | #define tsleep(chan, pri, wmesg, timo) \ | ||||
| _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ | _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \ | ||||
| 0, C_HARDCLOCK) | 0, C_HARDCLOCK) | ||||
| #define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \ | #define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \ | ||||
| _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags)) | _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags)) | ||||
| void wakeup(void *chan) __nonnull(1); | void wakeup(void * chan); | ||||
| void wakeup_one(void *chan) __nonnull(1); | void wakeup_one(void * chan); | ||||
Done Inline ActionsThis is complete nonsense, wait channel is just a token. kib: This is complete nonsense, wait channel is just a token. | |||||
Done Inline ActionsThis was just copied form the pre-existing _nonnull() invocation. pfg: This was just copied form the pre-existing _nonnull() invocation.
I will remove it. | |||||
| /* | /* | ||||
| * Common `struct cdev *' stuff are declared here to avoid #include poisoning | * Common `struct cdev *' stuff are declared here to avoid #include poisoning | ||||
| */ | */ | ||||
| struct cdev; | struct cdev; | ||||
| dev_t dev2udev(struct cdev *x); | dev_t dev2udev(struct cdev *x); | ||||
| const char *devtoname(struct cdev *cdev); | const char *devtoname(struct cdev *cdev); | ||||
| Show All 30 Lines | |||||
| int alloc_unrl(struct unrhdr *uh); | int alloc_unrl(struct unrhdr *uh); | ||||
| void free_unr(struct unrhdr *uh, u_int item); | void free_unr(struct unrhdr *uh, u_int item); | ||||
| void intr_prof_stack_use(struct thread *td, struct trapframe *frame); | void intr_prof_stack_use(struct thread *td, struct trapframe *frame); | ||||
| extern void (*softdep_ast_cleanup)(void); | extern void (*softdep_ast_cleanup)(void); | ||||
| void counted_warning(unsigned *counter, const char *msg); | void counted_warning(unsigned *counter, const char *msg); | ||||
| #if defined(__clang__) | |||||
| #pragma clang diagnostic pop | |||||
| #endif | |||||
| #endif /* !_SYS_SYSTM_H_ */ | #endif /* !_SYS_SYSTM_H_ */ | ||||
Why do you disable user address 0 ?