1 |
26 |
unneback |
#ifndef CYGONCE_HAL_BASETYPE_H
|
2 |
|
|
# define CYGONCE_HAL_BASETYPE_H
|
3 |
|
|
|
4 |
|
|
//======================================================================
|
5 |
|
|
//
|
6 |
|
|
// basetype.h
|
7 |
|
|
//
|
8 |
|
|
// HAL emulation for the host-side infrastructure.
|
9 |
|
|
//
|
10 |
|
|
//======================================================================
|
11 |
|
|
//####COPYRIGHTBEGIN####
|
12 |
|
|
//
|
13 |
|
|
// ----------------------------------------------------------------------------
|
14 |
|
|
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
|
15 |
|
|
//
|
16 |
|
|
// This file is part of the eCos host tools.
|
17 |
|
|
//
|
18 |
|
|
// This program is free software; you can redistribute it and/or modify it
|
19 |
|
|
// under the terms of the GNU General Public License as published by the Free
|
20 |
|
|
// Software Foundation; either version 2 of the License, or (at your option)
|
21 |
|
|
// any later version.
|
22 |
|
|
//
|
23 |
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
24 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
25 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
26 |
|
|
// more details.
|
27 |
|
|
//
|
28 |
|
|
// You should have received a copy of the GNU General Public License along with
|
29 |
|
|
// this program; if not, write to the Free Software Foundation, Inc.,
|
30 |
|
|
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
31 |
|
|
//
|
32 |
|
|
// ----------------------------------------------------------------------------
|
33 |
|
|
//
|
34 |
|
|
//####COPYRIGHTEND####
|
35 |
|
|
//======================================================================
|
36 |
|
|
//#####DESCRIPTIONBEGIN####
|
37 |
|
|
//
|
38 |
|
|
// Author(s): bartv
|
39 |
|
|
// Contact(s): bartv
|
40 |
|
|
// Date: 1998/07/13
|
41 |
|
|
// Version: 0.01
|
42 |
|
|
//
|
43 |
|
|
//####DESCRIPTIONEND####
|
44 |
|
|
//======================================================================
|
45 |
|
|
|
46 |
|
|
// The purpose of this header file is to replicate the functionality
|
47 |
|
|
// provided by <cyg/hal/basetype.h> on the target side. Essentially
|
48 |
|
|
// this file has to define endianness. Optionally it can also define
|
49 |
|
|
// the correct data types for e.g. cyg_count32 etc.
|
50 |
|
|
//
|
51 |
|
|
// On the host side portability is achieved by means of autoconf and
|
52 |
|
|
// feature tests, as opposed to re-implementing the HAL for each
|
53 |
|
|
// platform. In particular there will be a generated header file
|
54 |
|
|
// <pkgconf/hostinfra.h> which gets filled in during the configure
|
55 |
|
|
// process.
|
56 |
|
|
//
|
57 |
|
|
// It has been decided that the host side should use exactly the same
|
58 |
|
|
// infrastructure header files as the target side (although extra
|
59 |
|
|
// functionality may be defined in these header files where
|
60 |
|
|
// appropriate). This means that the host side needs to provide
|
61 |
|
|
// <cyg/hal/basetype.h>, even though it does not contain a HAL.
|
62 |
|
|
//
|
63 |
|
|
// This implementation of <cyg/hal/basetype.h> reads in the
|
64 |
|
|
// configuration header generated by the configure script and adapts
|
65 |
|
|
// this information into whatever is required by
|
66 |
|
|
// <cyg/infra/cyg_type.h>.
|
67 |
|
|
|
68 |
|
|
#ifndef CYGONCE_PKGCONF_INFRA_H
|
69 |
|
|
# include <pkgconf/infra.h>
|
70 |
|
|
#endif
|
71 |
|
|
|
72 |
|
|
// The autoconf test for endianness will result in a #define for
|
73 |
|
|
// LITTLE_ENDIAN_HOST on appropriate platforms. This needs to be
|
74 |
|
|
// converted into a definition of CYG_BYTEORDER as per the target-side
|
75 |
|
|
// HAL headers.
|
76 |
|
|
|
77 |
|
|
#ifdef WORDS_BIGENDIAN
|
78 |
|
|
# define CYG_BYTEORDER CYG_MSBFIRST
|
79 |
|
|
#else
|
80 |
|
|
# define CYG_BYTEORDER CYG_LSBFIRST
|
81 |
|
|
#endif
|
82 |
|
|
|
83 |
|
|
// The default definitions for cyg_halint8/16/32 and cyg_halcount8/16/32
|
84 |
|
|
// should be fine (although eventually we may come across a platform
|
85 |
|
|
// where int's are 64 bit). 64 bit arithmetic is a bit more of a problem.
|
86 |
|
|
// on the majority of systems so there is an autoconf test which will
|
87 |
|
|
// generate appropriate #define's for cyg_halint64 and cyg_halcount64,
|
88 |
|
|
// which means this header file does not to do anything more.
|
89 |
|
|
// cyg_halbool and cyg_halatomic should both be ok.
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
// Any symbols defined in <cyg/infra/config.h> which have been processed
|
93 |
|
|
// here should no longer be of any interest, and in the interests of
|
94 |
|
|
// reducing name space pollution they get undef'ed here.
|
95 |
|
|
#undef WORDS_BIGENDIAN
|
96 |
|
|
|
97 |
|
|
#endif // CYGONCE_HAL_BASETYPE_H
|
98 |
|
|
// End of basetype.h
|