Deleted Added
full compact
systm.h (315064) systm.h (315282)
1/*-
2 * Copyright (c) 1982, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 18 unchanged lines hidden (view full) ---

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)systm.h 8.7 (Berkeley) 3/29/95
1/*-
2 * Copyright (c) 1982, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 18 unchanged lines hidden (view full) ---

27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * @(#)systm.h 8.7 (Berkeley) 3/29/95
35 * $FreeBSD: stable/11/sys/sys/systm.h 315064 2017-03-11 09:22:53Z kib $
35 * $FreeBSD: stable/11/sys/sys/systm.h 315282 2017-03-14 20:14:57Z pfg $
36 */
37
38#ifndef _SYS_SYSTM_H_
39#define _SYS_SYSTM_H_
40
41#include <machine/atomic.h>
42#include <machine/cpufunc.h>
43#include <sys/callout.h>
44#include <sys/cdefs.h>
45#include <sys/queue.h>
46#include <sys/stdint.h> /* for people using printf mainly */
47
36 */
37
38#ifndef _SYS_SYSTM_H_
39#define _SYS_SYSTM_H_
40
41#include <machine/atomic.h>
42#include <machine/cpufunc.h>
43#include <sys/callout.h>
44#include <sys/cdefs.h>
45#include <sys/queue.h>
46#include <sys/stdint.h> /* for people using printf mainly */
47
48__NULLABILITY_PRAGMA_PUSH
49
48extern int cold; /* nonzero if we are doing a cold boot */
49extern int suspend_blocked; /* block suspend due to pending shutdown */
50extern int rebooting; /* kern_reboot() has been called. */
51extern const char *panicstr; /* panic message */
52extern char version[]; /* system version */
53extern char compiler_version[]; /* compiler version */
54extern char copyright[]; /* system copyright */
55extern int kstack_pages; /* number of kernel stack pages */

--- 166 unchanged lines hidden (view full) ---

222int uprintf(const char *, ...) __printflike(1, 2);
223int vprintf(const char *, __va_list) __printflike(1, 0);
224int vasprintf(char **ret, struct malloc_type *mtp, const char *format,
225 __va_list ap) __printflike(3, 0);
226int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0);
227int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0);
228int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
229int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
50extern int cold; /* nonzero if we are doing a cold boot */
51extern int suspend_blocked; /* block suspend due to pending shutdown */
52extern int rebooting; /* kern_reboot() has been called. */
53extern const char *panicstr; /* panic message */
54extern char version[]; /* system version */
55extern char compiler_version[]; /* compiler version */
56extern char copyright[]; /* system copyright */
57extern int kstack_pages; /* number of kernel stack pages */

--- 166 unchanged lines hidden (view full) ---

224int uprintf(const char *, ...) __printflike(1, 2);
225int vprintf(const char *, __va_list) __printflike(1, 0);
226int vasprintf(char **ret, struct malloc_type *mtp, const char *format,
227 __va_list ap) __printflike(3, 0);
228int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0);
229int vsnrprintf(char *, size_t, int, const char *, __va_list) __printflike(4, 0);
230int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0);
231int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3);
230int sscanf(const char *, char const *, ...) __nonnull(1) __nonnull(2);
231int vsscanf(const char *, char const *, __va_list) __nonnull(1) __nonnull(2);
232long strtol(const char *, char **, int) __nonnull(1);
233u_long strtoul(const char *, char **, int) __nonnull(1);
234quad_t strtoq(const char *, char **, int) __nonnull(1);
235u_quad_t strtouq(const char *, char **, int) __nonnull(1);
232int sscanf(const char *, char const * _Nonnull, ...) __scanflike(2, 3);
233int vsscanf(const char * _Nonnull, char const * _Nonnull, __va_list) __scanflike(2, 0);
234long strtol(const char *, char **, int);
235u_long strtoul(const char *, char **, int);
236quad_t strtoq(const char *, char **, int);
237u_quad_t strtouq(const char *, char **, int);
236void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4);
237void vtprintf(struct proc *, int, const char *, __va_list) __printflike(3, 0);
238void hexdump(const void *ptr, int length, const char *hdr, int flags);
239#define HD_COLUMN_MASK 0xff
240#define HD_DELIM_MASK 0xff00
241#define HD_OMIT_COUNT (1 << 16)
242#define HD_OMIT_HEX (1 << 17)
243#define HD_OMIT_CHARS (1 << 18)
244
245#define ovbcopy(f, t, l) bcopy((f), (t), (l))
238void tprintf(struct proc *p, int pri, const char *, ...) __printflike(3, 4);
239void vtprintf(struct proc *, int, const char *, __va_list) __printflike(3, 0);
240void hexdump(const void *ptr, int length, const char *hdr, int flags);
241#define HD_COLUMN_MASK 0xff
242#define HD_DELIM_MASK 0xff00
243#define HD_OMIT_COUNT (1 << 16)
244#define HD_OMIT_HEX (1 << 17)
245#define HD_OMIT_CHARS (1 << 18)
246
247#define ovbcopy(f, t, l) bcopy((f), (t), (l))
246void bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2);
247void bzero(void *buf, size_t len) __nonnull(1);
248void explicit_bzero(void *, size_t) __nonnull(1);
248void bcopy(const void * _Nonnull from, void * _Nonnull to, size_t len);
249void bzero(void * _Nonnull buf, size_t len);
250void explicit_bzero(void * _Nonnull, size_t);
249
251
250void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2);
251void *memmove(void *dest, const void *src, size_t n) __nonnull(1) __nonnull(2);
252void *memcpy(void * _Nonnull to, const void * _Nonnull from, size_t len);
253void *memmove(void * _Nonnull dest, const void * _Nonnull src, size_t n);
252
254
253int copystr(const void * __restrict kfaddr, void * __restrict kdaddr,
254 size_t len, size_t * __restrict lencopied)
255 __nonnull(1) __nonnull(2);
256int copyinstr(const void * __restrict udaddr, void * __restrict kaddr,
257 size_t len, size_t * __restrict lencopied)
258 __nonnull(1) __nonnull(2);
259int copyin(const void * __restrict udaddr, void * __restrict kaddr,
260 size_t len) __nonnull(1) __nonnull(2);
261int copyin_nofault(const void * __restrict udaddr, void * __restrict kaddr,
262 size_t len) __nonnull(1) __nonnull(2);
263int copyout(const void * __restrict kaddr, void * __restrict udaddr,
264 size_t len) __nonnull(1) __nonnull(2);
265int copyout_nofault(const void * __restrict kaddr, void * __restrict udaddr,
266 size_t len) __nonnull(1) __nonnull(2);
255int copystr(const void * _Nonnull __restrict kfaddr,
256 void * _Nonnull __restrict kdaddr, size_t len,
257 size_t * __restrict lencopied);
258int copyinstr(const void * __restrict udaddr,
259 void * _Nonnull __restrict kaddr, size_t len,
260 size_t * __restrict lencopied);
261int copyin(const void * _Nonnull __restrict udaddr,
262 void * _Nonnull __restrict kaddr, size_t len);
263int copyin_nofault(const void * _Nonnull __restrict udaddr,
264 void * _Nonnull __restrict kaddr, size_t len);
265int copyout(const void * _Nonnull __restrict kaddr,
266 void * _Nonnull __restrict udaddr, size_t len);
267int copyout_nofault(const void * _Nonnull __restrict kaddr,
268 void * _Nonnull __restrict udaddr, size_t len);
267
268int fubyte(volatile const void *base);
269long fuword(volatile const void *base);
270int fuword16(volatile const void *base);
271int32_t fuword32(volatile const void *base);
272int64_t fuword64(volatile const void *base);
273int fueword(volatile const void *base, long *val);
274int fueword32(volatile const void *base, int32_t *val);

--- 97 unchanged lines hidden (view full) ---

372static __inline intrmask_t splnet(void) { return 0; }
373static __inline intrmask_t spltty(void) { return 0; }
374static __inline void splx(intrmask_t ipl __unused) { return; }
375
376/*
377 * Common `proc' functions are declared here so that proc.h can be included
378 * less often.
379 */
269
270int fubyte(volatile const void *base);
271long fuword(volatile const void *base);
272int fuword16(volatile const void *base);
273int32_t fuword32(volatile const void *base);
274int64_t fuword64(volatile const void *base);
275int fueword(volatile const void *base, long *val);
276int fueword32(volatile const void *base, int32_t *val);

--- 97 unchanged lines hidden (view full) ---

374static __inline intrmask_t splnet(void) { return 0; }
375static __inline intrmask_t spltty(void) { return 0; }
376static __inline void splx(intrmask_t ipl __unused) { return; }
377
378/*
379 * Common `proc' functions are declared here so that proc.h can be included
380 * less often.
381 */
380int _sleep(void *chan, struct lock_object *lock, int pri, const char *wmesg,
381 sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1);
382int _sleep(void * _Nonnull chan, struct lock_object *lock, int pri,
383 const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags);
382#define msleep(chan, mtx, pri, wmesg, timo) \
383 _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \
384 tick_sbt * (timo), 0, C_HARDCLOCK)
385#define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \
386 _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \
387 (flags))
384#define msleep(chan, mtx, pri, wmesg, timo) \
385 _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), \
386 tick_sbt * (timo), 0, C_HARDCLOCK)
387#define msleep_sbt(chan, mtx, pri, wmesg, bt, pr, flags) \
388 _sleep((chan), &(mtx)->lock_object, (pri), (wmesg), (bt), (pr), \
389 (flags))
388int msleep_spin_sbt(void *chan, struct mtx *mtx, const char *wmesg,
389 sbintime_t sbt, sbintime_t pr, int flags) __nonnull(1);
390int msleep_spin_sbt(void * _Nonnull chan, struct mtx *mtx,
391 const char *wmesg, sbintime_t sbt, sbintime_t pr, int flags);
390#define msleep_spin(chan, mtx, wmesg, timo) \
391 msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \
392 0, C_HARDCLOCK)
393int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr,
394 int flags);
395#define pause(wmesg, timo) \
396 pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
397#define tsleep(chan, pri, wmesg, timo) \
398 _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \
399 0, C_HARDCLOCK)
400#define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \
401 _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags))
392#define msleep_spin(chan, mtx, wmesg, timo) \
393 msleep_spin_sbt((chan), (mtx), (wmesg), tick_sbt * (timo), \
394 0, C_HARDCLOCK)
395int pause_sbt(const char *wmesg, sbintime_t sbt, sbintime_t pr,
396 int flags);
397#define pause(wmesg, timo) \
398 pause_sbt((wmesg), tick_sbt * (timo), 0, C_HARDCLOCK)
399#define tsleep(chan, pri, wmesg, timo) \
400 _sleep((chan), NULL, (pri), (wmesg), tick_sbt * (timo), \
401 0, C_HARDCLOCK)
402#define tsleep_sbt(chan, pri, wmesg, bt, pr, flags) \
403 _sleep((chan), NULL, (pri), (wmesg), (bt), (pr), (flags))
402void wakeup(void *chan) __nonnull(1);
403void wakeup_one(void *chan) __nonnull(1);
404void wakeup(void * chan);
405void wakeup_one(void * chan);
404
405/*
406 * Common `struct cdev *' stuff are declared here to avoid #include poisoning
407 */
408
409struct cdev;
410dev_t dev2udev(struct cdev *x);
411const char *devtoname(struct cdev *cdev);

--- 29 unchanged lines hidden (view full) ---

441int alloc_unr_specific(struct unrhdr *uh, u_int item);
442int alloc_unrl(struct unrhdr *uh);
443void free_unr(struct unrhdr *uh, u_int item);
444
445void intr_prof_stack_use(struct thread *td, struct trapframe *frame);
446
447void counted_warning(unsigned *counter, const char *msg);
448
406
407/*
408 * Common `struct cdev *' stuff are declared here to avoid #include poisoning
409 */
410
411struct cdev;
412dev_t dev2udev(struct cdev *x);
413const char *devtoname(struct cdev *cdev);

--- 29 unchanged lines hidden (view full) ---

443int alloc_unr_specific(struct unrhdr *uh, u_int item);
444int alloc_unrl(struct unrhdr *uh);
445void free_unr(struct unrhdr *uh, u_int item);
446
447void intr_prof_stack_use(struct thread *td, struct trapframe *frame);
448
449void counted_warning(unsigned *counter, const char *msg);
450
451__NULLABILITY_PRAGMA_POP
452
449#endif /* !_SYS_SYSTM_H_ */
453#endif /* !_SYS_SYSTM_H_ */