RTEMS CPU Kit with SuperCore  4.11.3
systm.h
Go to the documentation of this file.
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.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  * 4. Neither the name of the University nor the names of its contributors
19  * may be used to endorse or promote products derived from this software
20  * without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
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: src/sys/sys/systm.h,v 1.248 2007/01/15 15:06:27 rrs Exp $
36  */
37 
38 
39 #ifndef _SYS_SYSTM_H_
40 #define _SYS_SYSTM_H_
41 
42 #include <rtems/rtems_bsdnet_internal.h> /* for __BSD_VA_LIST__ */
43 #include <machine/cpufunc.h>
44 
45 #if !defined(__dead2)
46 #define __dead2 __attribute__((__noreturn__))
47 #endif
48 
49 extern int securelevel; /* system security level (see init(8)) */
50 
51 extern int cold; /* nonzero if we are doing a cold boot */
52 extern const char *panicstr; /* panic message */
53 extern char version[]; /* system version */
54 extern char copyright[]; /* system copyright */
55 
56 extern int physmem; /* physical memory */
57 
58 /*
59  * General function declarations.
60  */
61 int nullop(void);
62 int ureadc(int, struct uio *);
63 void *hashinit(int count, int type, u_long *hashmask);
64 void *phashinit(int count, int type, u_long *nentries);
65 
66 void panic(const char *, ...) __dead2;
67 void boot(int) __dead2;
68 void cpu_boot(int);
69 int kvprintf(char const *, void (*)(int, void*), void *, int,
70  _BSD_VA_LIST_);
71 void log(int, const char *, ...);
72 int printf(const char *, ...);
73 int sprintf(char *buf, const char *, ...);
74 void uprintf(const char *, ...);
75 void ttyprintf(struct tty *, const char *, ...);
76 
77 #define bcopy(f,t,n) memcpy((t),(f),(n))
78 #define bzero(p,n) memset((p),(0),(n))
79 
80 int copystr(const void *kfaddr, void *kdaddr, size_t len,
81  size_t *lencopied);
82 int copyinstr(const void *udaddr, void *kaddr, size_t len,
83  size_t *lencopied);
84 #ifndef __rtems__
85 /* FIXME: these clash with defines in rtems_bsdnet_internal.h */
86 int copyin(const void *udaddr, void *kaddr, size_t len);
87 int copyout(const void *kaddr, void *udaddr, size_t len);
88 #endif
89 
90 int hzto(struct timeval *tv);
91 
92 #include <sys/libkern.h>
93 
94 /* Timeouts */
95 typedef void (timeout_t)(void *); /* actual timeout function type */
96 typedef timeout_t *timeout_func_t; /* a pointer to this type */
97 
98 void timeout(timeout_func_t, void *, int);
99 void untimeout(timeout_func_t, void *);
100 
101 /*
102  * Common `proc' functions are declared here so that proc.h can be included
103  * less often.
104  */
105 int tsleep(void *chan, int pri, char *wmesg, int timo);
106 void wakeup(void *chan);
107 
108 #endif /* !_SYS_SYSTM_H_ */