]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/net/bsd_tcpip/v2_0/include/sys/bsdtypes.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / net / bsd_tcpip / v2_0 / include / sys / bsdtypes.h
1 //==========================================================================
2 //
3 //      include/sys/bsdtypes.h
4 //
5 //==========================================================================
6 //####BSDCOPYRIGHTBEGIN####
7 //
8 // -------------------------------------------
9 //
10 // Portions of this software may have been derived from OpenBSD, 
11 // FreeBSD or other sources, and are covered by the appropriate
12 // copyright disclaimers included herein.
13 //
14 // Portions created by Red Hat are
15 // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
16 //
17 // -------------------------------------------
18 //
19 //####BSDCOPYRIGHTEND####
20 //==========================================================================
21
22 #ifndef _SYS_BSDTYPES_H_
23 #define _SYS_BSDTYPES_H_
24
25 #include <cyg/infra/cyg_type.h>
26 #include <cyg/hal/hal_arch.h>
27
28 #define __BIT_TYPES_DEFINED__
29 #undef uint8_t
30 #undef uint16_t
31 #undef uint32_t
32 #undef int8_t
33 #undef int16_t
34 #undef int32_t
35
36 typedef __signed char              int8_t;
37 typedef unsigned char            u_int8_t;
38 typedef unsigned char             uint8_t;
39 typedef short                     int16_t;
40 typedef unsigned short          u_int16_t;
41 typedef unsigned short           uint16_t;
42 typedef int                       int32_t;
43 typedef unsigned int            u_int32_t;
44 typedef unsigned int             uint32_t;
45 typedef long long                 int64_t;
46 typedef unsigned long long      u_int64_t;
47 typedef unsigned long long       uint64_t;
48
49 // Types inherited from HAL 
50
51 typedef CYG_ADDRESS               vaddr_t;
52 typedef CYG_ADDRWORD              vsize_t;
53 typedef CYG_ADDRESS               paddr_t;
54 typedef CYG_ADDRWORD              psize_t;
55
56 typedef CYG_ADDRESS           vm_offset_t;
57 typedef CYG_ADDRWORD            vm_size_t;
58
59 // No good HAL definition for this
60
61 typedef CYG_ADDRWORD           register_t;
62
63
64 // From <arch/ansi.h>
65 /*
66  * Types which are fundamental to the implementation and may appear in
67  * more than one standard header are defined here.  Standard headers
68  * then use:
69  *      #ifdef  _BSD_SIZE_T_
70  *      typedef _BSD_SIZE_T_ size_t;
71  *      #undef  _BSD_SIZE_T_
72  *      #endif
73  */
74 #define _BSD_SSIZE_T_   int              /* byte count or error */
75 #define _BSD_CLOCKID_T_ int
76 #define _BSD_TIMER_T_   int
77 #ifndef __time_t_defined                 // As defined/used by eCos libc
78 #define _BSD_CLOCK_T_   cyg_int64        /* clock() */
79 #define _BSD_TIME_T_    cyg_count32      /* time() */
80 #endif
81
82 #endif // _MACHINE_TYPES_H_
83
84 // Standard BSD types
85 typedef unsigned char   u_char;
86 typedef unsigned short  u_short;
87 typedef unsigned int    u_int;
88 typedef unsigned long   u_long;
89 typedef char           *caddr_t;
90
91 typedef u_int64_t       u_quad_t;       /* quads */
92 typedef int64_t         quad_t;
93 typedef quad_t *        qaddr_t;
94
95 /*
96  * XPG4.2 states that inclusion of <netinet/in.h> must pull these
97  * in and that inclusion of <sys/socket.h> must pull in sa_family_t.
98  * We put there here because there are other headers that require
99  * these types and <sys/socket.h> and <netinet/in.h> will indirectly
100  * include <sys/types.h>.  Thus we are compliant without too many hoops.
101  */
102 typedef u_int32_t       in_addr_t;      /* base type for internet address */
103 typedef u_int16_t       in_port_t;      /* IP port type */
104 typedef u_int8_t        sa_family_t;    /* sockaddr address family type */
105 typedef u_int32_t       socklen_t;      /* length type for network syscalls */