source: rtems/c/src/exec/libnetworking/rtems/rtems_bsdnet_internal.h @ 33679ec4

4.104.114.84.95
Last change on this file since 33679ec4 was 33679ec4, checked in by Joel Sherrill <joel.sherrill@…>, on 08/21/98 at 13:04:55

All warnings removed.

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