OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [libnetworking/] [rtems/] [rtems_bsdnet_internal.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.