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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [port/] [port.h] - Blame information for rev 121

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 jeremybenn
/* port.h -- Portability interface header
2
 
3
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
4
   Copyright (C) 2008 Embecosm Limited
5
 
6
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7
 
8
   This file is part of OpenRISC 1000 Architectural Simulator.
9
 
10
   This program is free software; you can redistribute it and/or modify it
11
   under the terms of the GNU General Public License as published by the Free
12
   Software Foundation; either version 3 of the License, or (at your option)
13
   any later version.
14
 
15
   This program is distributed in the hope that it will be useful, but WITHOUT
16
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
   more details.
19
 
20
   You should have received a copy of the GNU General Public License along
21
   with this program.  If not, see <http://www.gnu.org/licenses/>. */
22
 
23
/* This program is commented throughout in a fashion suitable for processing
24
   with Doxygen. */
25
 
26
 
27
#ifndef PORT__H
28
#define PORT__H
29
 
30
/* System includes */
31
#include <string.h>
32
#include <ctype.h>
33
 
34
#if HAVE_INTTYPES_H
35
#include <inttypes.h>
36
#endif
37
 
38
 
39
/* Substitute strndup () if necessary */
40
#ifndef HAVE_STRNDUP
41
char * strndup (const char *s, size_t n);
42
#endif
43
 
44
/* Substitute isblank () if necessary */
45
#ifndef HAVE_ISBLANK
46
int isblank(int c);
47
#endif
48
 
49
/* Substitute all the inttypes fields that are missing */
50
 
51
#ifndef PRIx32
52
# if SIZEOF_INT == 4
53
#  define PRIx32 "x"
54
# elif SIZEOF_LONG == 4
55
#  define PRIx32 "lx"
56
# endif
57
#endif
58
 
59
#ifndef PRIx16
60
# if SIZEOF_SHORT == 2
61
#  define PRIx16 "hx"
62
# else
63
#  define PRIx16 "x"
64
# endif
65
#endif
66
 
67
#ifndef PRIx8
68
# if SIZEOF_CHAR == 1
69
#  define PRIx8 "hhx"
70
# else
71
#  define PRIx8 "x"
72
# endif
73
#endif
74
 
75
#ifndef PRIi32
76
# if SIZEOF_INT == 4
77
#  define PRIi32 "i"
78
# elif SIZEOF_LONG == 4
79
#  define PRIi32 "li"
80
# endif
81
#endif
82
 
83
#ifndef PRId32
84
# if SIZEOF_INT == 4
85
#  define PRId32 "d"
86
# elif SIZEOF_LONG == 4
87
#  define PRId32 "ld"
88
# endif
89
#endif
90
 
91
#ifndef UINT32_C
92
# if SIZEOF_INT == 4
93
#  define UINT32_C(c) c
94
# elif SIZEOF_LONG == 4
95
#  define UINT32_C(c) c l
96
# endif
97
#endif
98
 
99
#ifndef HAVE_UINT32_T
100
# if SIZEOF_INT == 4
101
typedef unsigned int uint32_t;
102
# elif SIZEOF_LONG == 4
103
typedef unsigned long uint32_t;
104
# else
105
#  error "Can't find a 32-bit type"
106
# endif
107
#endif
108
 
109
#ifndef HAVE_INT32_T
110
# if SIZEOF_INT == 4
111
typedef signed int int32_t;
112
# elif SIZEOF_LONG == 4
113
typedef signed long int32_t;
114
# endif
115
#endif
116
 
117
#ifndef HAVE_UINT16_T
118
# if SIZEOF_SHORT == 2
119
typedef unsigned short uint16_t;
120
# else
121
#  error "Can't find a 16-bit type"
122
# endif
123
#endif
124
 
125
#ifndef HAVE_INT16_T
126
# if SIZEOF_SHORT == 2
127
typedef signed short int16_t;
128
# endif
129
#endif
130
 
131
#ifndef HAVE_UINT8_T
132
# if SIZEOF_CHAR == 1
133
typedef unsigned char uint8_t;
134
# else
135
#  error "Can't find a 8-bit type"
136
# endif
137
#endif
138
 
139
#ifndef HAVE_INT8_T
140
# if SIZEOF_CHAR == 1
141
typedef signed char int8_t;
142
# endif
143
#endif
144
 
145
 
146
#endif  /* PORT__H */

powered by: WebSVN 2.1.0

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