source: rtems/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h @ ff0f694d

4.104.114.84.95
Last change on this file since ff0f694d was ff0f694d, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/98 at 21:47:37

Fixed many warnings.

  • Property mode set to 100644
File size: 3.8 KB
Line 
1/*
2 * Declarations to fit FreeBSD to RTEMS.
3 * This include file should *never* be exposed to the application programmer.
4 */
5
6#ifndef _RTEMS_BSDNET_INTERNAL_H_
7#define _RTEMS_BSDNET_INTERNAL_H_
8
9typedef unsigned int            vm_offset_t;
10typedef long long               vm_ooffset_t;
11typedef unsigned int            vm_pindex_t;
12typedef unsigned int            vm_size_t;
13
14#define _BSD_OFF_T_     rtems_signed32
15#define _BSD_PID_T_     rtems_id
16#define _BSD_VA_LIST_   char *
17
18#include <sys/time.h>
19struct  itimerval {
20  struct  timeval it_interval;
21  struct  timeval it_value;
22};
23struct mdproc {
24        int     md_flags;
25        int     *md_regs;
26};
27
28#define USHRT_MAX       65535
29
30/*
31 * Other RTEMS/BSD glue
32 */
33struct socket;
34extern void soconnsleep (struct socket *so);
35extern void soconnwakeup (struct socket *so);
36#define splnet()        0
37#define splimp()        0
38#define splx(_s)        do { (_s) = 0; } while(0)
39
40#define ovbcopy(f,t,n) bcopy(f,t,n)
41#define copyout(f,t,n) (memcpy(t,f,n),0)
42#define copyin(f,t,n) (memcpy(t,f,n),0)
43
44#define random()        rtems_bsdnet_random()
45#define panic   rtems_panic
46#define suser(a,b)      0
47
48void    microtime (struct timeval *tv);
49#define hz rtems_bsdnet_ticks_per_second
50#define tick rtems_bsdnet_microseconds_per_tick
51
52#define SHRT_MAX 65535
53
54#define log     rtems_bsdnet_log
55
56/*
57 * Since we can't have two sys/types.h files, we'll hack around
58 * and copy the contents of the BSD sys/types.h to here....
59 */
60#include <sys/cdefs.h>
61
62typedef u_int64_t       u_quad_t;       /* quads */
63typedef int64_t         quad_t;
64typedef quad_t *        qaddr_t;
65
66typedef void __sighandler_t __P((int));
67typedef __sighandler_t  *sig_t; /* type of pointer to a signal function */
68#define NSIG    32
69struct  sigaltstack {
70        char    *ss_sp;                 /* signal stack base */
71        int     ss_size;                /* signal stack length */
72        int     ss_flags;               /* SS_DISABLE and/or SS_ONSTACK */
73};
74
75#ifdef KERNEL
76typedef int             boolean_t;
77typedef struct vm_page  *vm_page_t;
78#endif
79
80#ifndef _POSIX_SOURCE
81/*
82 * minor() gives a cookie instead of an index since we don't want to
83 * change the meanings of bits 0-15 or waste time and space shifting
84 * bits 16-31 for devices that don't use them.
85 */
86#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
87#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
88#define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
89#endif
90
91#include <machine/endian.h>
92
93typedef quad_t          rlim_t;         /* resource limit */
94typedef u_int32_t       fixpt_t;        /* fixed point number */
95
96/*
97 * Forward structure declarations for function prototypes.  We include the
98 * common structures that cross subsystem boundaries here; others are mostly
99 * used in the same place that the structure is defined.
100 */
101struct  proc;
102struct  pgrp;
103struct  ucred;
104struct  rusage;
105struct  file;
106struct  buf;
107struct  tty;
108struct  uio;
109
110/*
111 * Redo kernel memory allocation
112 */
113#define malloc rtems_bsdnet_malloc
114#define free rtems_bsdnet_free
115
116#define M_NOWAIT        0x0001
117void *rtems_bsdnet_malloc (unsigned long size, int type, int flags);
118void rtems_bsdnet_free (void *addr, int type);
119
120void rtems_bsdnet_semaphore_obtain (void);
121void rtems_bsdnet_semaphore_release (void);
122void rtems_bsdnet_schednetisr (int n);
123
124unsigned long rtems_bsdnet_seconds_since_boot (void);
125unsigned long rtems_bsdnet_random (void);
126
127rtems_id rtems_bsdnet_newproc (
128  char  *name,
129  int   stacksize,
130  void  (*entry)(void *),
131  void  *arg
132);
133
134rtems_status_code rtems_bsdnet_event_receive (
135  rtems_event_set  event_in,
136  rtems_option     option_set,
137  rtems_interval   ticks,
138  rtems_event_set *event_out
139);
140
141/*
142 * Network configuration
143 */
144extern int rtems_bsdnet_ticks_per_second;
145extern int rtems_bsdnet_microseconds_per_tick;
146extern struct in_addr rtems_bsdnet_log_host_address;
147extern char *rtems_bsdnet_domain_name;
148extern struct in_addr rtems_bsdnet_nameserver[];
149extern int rtems_bsdnet_nameserver_count;
150
151/*
152 * Internal IOCTL command
153 */
154#define SIO_RTEMS_SHOW_STATS    _IO('i', 250)
155
156#endif /* _RTEMS_BSDNET_INTERNAL_H_ */
Note: See TracBrowser for help on using the repository browser.