1 //==========================================================================
3 // include/sys/bsdtypes.h
5 //==========================================================================
6 //####BSDCOPYRIGHTBEGIN####
8 // -------------------------------------------
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.
14 // Portions created by Red Hat are
15 // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
17 // -------------------------------------------
19 //####BSDCOPYRIGHTEND####
20 //==========================================================================
22 #ifndef _SYS_BSDTYPES_H_
23 #define _SYS_BSDTYPES_H_
25 #include <cyg/infra/cyg_type.h>
26 #include <cyg/hal/hal_arch.h>
28 #define __BIT_TYPES_DEFINED__
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;
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;
49 // Types inherited from HAL
51 typedef CYG_ADDRESS vaddr_t;
52 typedef CYG_ADDRWORD vsize_t;
53 typedef CYG_ADDRESS paddr_t;
54 typedef CYG_ADDRWORD psize_t;
56 typedef CYG_ADDRESS vm_offset_t;
57 typedef CYG_ADDRWORD vm_size_t;
59 // No good HAL definition for this
61 typedef CYG_ADDRWORD register_t;
66 * Types which are fundamental to the implementation and may appear in
67 * more than one standard header are defined here. Standard headers
70 * typedef _BSD_SIZE_T_ size_t;
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() */
82 #endif // _MACHINE_TYPES_H_
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;
91 typedef u_int64_t u_quad_t; /* quads */
92 typedef int64_t quad_t;
93 typedef quad_t * qaddr_t;
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.
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 */