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

4.115
Last change on this file since ae55da72 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 5.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
10#ifndef _RTEMS_RTEMS_BSDNET_INTERNAL_H
11#define _RTEMS_RTEMS_BSDNET_INTERNAL_H
12
13#include <rtems.h>
14#include <rtems/fs.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20typedef unsigned int            vm_offset_t;
21typedef long long               vm_ooffset_t;
22typedef unsigned int            vm_pindex_t;
23typedef unsigned int            vm_size_t;
24
25#ifndef __ioctl_command_defined
26typedef u_int32_t ioctl_command_t;
27#define __ioctl_command_defined
28#endif
29
30
31#define _BSD_OFF_T_     int32_t
32#define _BSD_PID_T_     rtems_id
33#define _BSD_VA_LIST_   char *
34
35/* make sure we get the network versions of these */
36#include <machine/types.h>
37#include <machine/param.h>
38#include <sys/cdefs.h>
39
40#include <sys/time.h>
41
42struct mdproc {
43        int     md_flags;
44        int     *md_regs;
45};
46
47/*
48 * Other RTEMS/BSD glue
49 */
50struct socket;
51extern int soconnsleep (struct socket *so);
52extern void soconnwakeup (struct socket *so);
53#define splnet()        0
54#define splimp()        0
55#define splx(_s)        do { (_s) = 0; } while(0)
56
57/* to avoid warnings */
58void *memcpy(void *dest, const void *src, size_t n);
59void *memset(void *s, int c, size_t n);
60
61#define ovbcopy(f,t,n) bcopy(f,t,n)
62#define copyout(f,t,n) (memcpy(t,f,n),0)
63#define copyin(f,t,n) (memcpy(t,f,n),0)
64
65#define random()        rtems_bsdnet_random()
66#define panic   rtems_panic
67#define suser(a,b)      0
68
69void    microtime (struct timeval *tv);
70#define hz rtems_bsdnet_ticks_per_second
71#define tick rtems_bsdnet_microseconds_per_tick
72
73#define log     rtems_bsdnet_log
74
75/*
76 * Since we can't have two sys/types.h files, we'll hack around
77 * and copy the contents of the BSD sys/types.h to here....
78 */
79
80typedef u_int64_t       u_quad_t;       /* quads */
81typedef int64_t         quad_t;
82typedef quad_t *        qaddr_t;
83
84typedef void __sighandler_t(int);
85typedef __sighandler_t  *sig_t; /* type of pointer to a signal function */
86#define NSIG    32
87struct  sigaltstack {
88        char    *ss_sp;                 /* signal stack base */
89        int     ss_size;                /* signal stack length */
90        int     ss_flags;               /* SS_DISABLE and/or SS_ONSTACK */
91};
92
93#ifdef _KERNEL
94typedef int             boolean_t;
95#endif
96
97#ifndef _POSIX_SOURCE
98/*
99 * minor() gives a cookie instead of an index since we don't want to
100 * change the meanings of bits 0-15 or waste time and space shifting
101 * bits 16-31 for devices that don't use them.
102 */
103#define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
104#define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
105#define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
106#endif
107
108#include <rtems/endian.h>
109
110typedef quad_t          rlim_t;         /* resource limit */
111typedef u_int32_t       fixpt_t;        /* fixed point number */
112
113/*
114 * Forward structure declarations for function prototypes.  We include the
115 * common structures that cross subsystem boundaries here; others are mostly
116 * used in the same place that the structure is defined.
117 */
118struct  proc;
119struct  pgrp;
120struct  ucred;
121struct  rusage;
122struct  buf;
123struct  tty;
124struct  uio;
125struct  rtems_bsdnet_ifconfig;
126
127/*
128 * Redo kernel memory allocation
129 */
130#define malloc(size,type,flags) rtems_bsdnet_malloc(size,type,flags)
131#define free(ptr,type) rtems_bsdnet_free(ptr,type)
132#define timeout(ftn,arg,ticks) rtems_bsdnet_timeout(ftn,arg,ticks)
133
134#define M_NOWAIT        0x0001
135void *rtems_bsdnet_malloc (size_t size, int type, int flags);
136void rtems_bsdnet_free (void *addr, int type);
137
138void rtems_bsdnet_semaphore_obtain (void);
139void rtems_bsdnet_semaphore_release (void);
140void rtems_bsdnet_schednetisr (int n);
141int rtems_bsdnet_parse_driver_name (const struct rtems_bsdnet_ifconfig *config, char **namep);
142
143unsigned long rtems_bsdnet_seconds_since_boot (void);
144unsigned long rtems_bsdnet_random (void);
145
146rtems_id rtems_bsdnet_newproc (
147  char  *name,
148  int   stacksize,
149  void  (*entry)(void *),
150  void  *arg
151);
152
153rtems_status_code rtems_bsdnet_event_receive (
154  rtems_event_set  event_in,
155  rtems_option     option_set,
156  rtems_interval   ticks,
157  rtems_event_set *event_out
158);
159
160/*
161 * Network configuration
162 */
163extern int rtems_bsdnet_ticks_per_second;
164extern int rtems_bsdnet_microseconds_per_tick;
165extern struct in_addr rtems_bsdnet_log_host_address;
166extern char *rtems_bsdnet_domain_name;
167
168/*
169 * Internal IOCTL command
170 */
171#define SIO_RTEMS_SHOW_STATS    _IO('i', 250)
172
173/*
174 * Some extra prototypes
175 */
176int sethostname (char *name, size_t namelen);
177void domaininit (void *);
178void ifinit (void *);
179void ipintr (void);
180void arpintr (void);
181bool bootpc_init(bool, bool);
182int socket (int, int, int);
183int ioctl (int, ioctl_command_t, ...);
184
185/*
186 * Events used by networking routines.
187 * Everything will break if the application
188 * tries to use these events or if the `sleep'
189 * events are equal to any of the NETISR * events.
190 */
191#define SBWAIT_EVENT   RTEMS_EVENT_24
192#define SOSLEEP_EVENT  RTEMS_EVENT_25
193#define NETISR_IP_EVENT        (1L << NETISR_IP)
194#define NETISR_ARP_EVENT       (1L << NETISR_ARP)
195#define NETISR_EVENTS  (NETISR_IP_EVENT|NETISR_ARP_EVENT)
196#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
197# error "Network event conflict"
198#endif
199
200struct socket *rtems_bsdnet_fdToSocket(int fd);
201
202#ifdef __cplusplus
203}
204#endif
205
206#endif /* _RTEMS_RTEMS_BSDNET_INTERNAL_H */
Note: See TracBrowser for help on using the repository browser.