Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: Datatype.h | |
5 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. | |
7 | * | |
8 | * The above named program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public | |
10 | * License version 2 as published by the Free Software Foundation. | |
11 | * | |
12 | * The above named program is distributed in the hope that it will be | |
13 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public | |
18 | * License along with this work; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | |
20 | * | |
21 | * ========== Copyright Header End ============================================ | |
22 | */ | |
23 | #ifndef __Datatype_h | |
24 | #define __Datatype_h | |
25 | ||
26 | #include <limits.h> | |
27 | ||
28 | /** @file Datatype.h | |
29 | * Datatype.h defines useful primitive types and values. | |
30 | */ | |
31 | ||
32 | #ifndef __FixedSizeTypes | |
33 | #define __FixedSizeTypes | |
34 | typedef signed char int8; | |
35 | typedef short int16; | |
36 | typedef int int32; | |
37 | typedef long long int64; | |
38 | ||
39 | typedef unsigned char uchar, uint8; | |
40 | typedef unsigned short ushort, uint16; | |
41 | typedef unsigned int uint, uint32; | |
42 | ||
43 | #ifdef _LP64 | |
44 | typedef unsigned long uint64; | |
45 | #else /* _ILP32 */ | |
46 | #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG) | |
47 | typedef unsigned long long uint64; | |
48 | ||
49 | #endif | |
50 | #endif | |
51 | ||
52 | #endif | |
53 | ||
54 | typedef uint8 Byte; | |
55 | typedef uint64 Addr; | |
56 | typedef uint64 Data; | |
57 | typedef uint64 Identifier; | |
58 | ||
59 | typedef int64 Time; /* global simulation time (ticks of the root domain) */ | |
60 | typedef double Period; /* period of a domain in cycles of the root domain */ | |
61 | typedef double Freq; /* frequency in Hz of a particular domain */ | |
62 | ||
63 | static const Addr MIN_ADDR = (Addr) 0; | |
64 | static const Addr MAX_ADDR = (Addr) ULLONG_MAX; | |
65 | ||
66 | static const Time NOT_A_TIME = (Time) LLONG_MIN; | |
67 | static const Time PAST_TIME = (Time) (LLONG_MIN +1); | |
68 | static const Time INITIAL_TIME = (Time) -1; | |
69 | static const Time FUTURE_TIME = (Time) LLONG_MAX; | |
70 | ||
71 | #endif |