Randall Spangler | f302905 | 2010-06-16 13:42:58 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 | * Use of this source code is governed by a BSD-style license that can be |
| 3 | * found in the LICENSE file. |
| 4 | */ |
| 5 | |
| 6 | /* System includes for vboot reference library. This is the ONLY |
Randall Spangler | 620c38c | 2010-06-17 14:45:22 -0700 | [diff] [blame] | 7 | * place in firmware/ where system headers may be included via |
Randall Spangler | f302905 | 2010-06-16 13:42:58 -0700 | [diff] [blame] | 8 | * #include <...>, so that there's only one place that needs to be |
| 9 | * fixed up for platforms which don't have all the system includes. |
| 10 | * |
Randall Spangler | 620c38c | 2010-06-17 14:45:22 -0700 | [diff] [blame] | 11 | * Files in firmware/stub may still include system headers, because |
| 12 | * they're local implementations and will be ported to each system |
| 13 | * anyway. */ |
Randall Spangler | f302905 | 2010-06-16 13:42:58 -0700 | [diff] [blame] | 14 | |
| 15 | #ifndef VBOOT_REFERENCE_SYSINCLUDES_H_ |
| 16 | #define VBOOT_REFERENCE_SYSINCLUDES_H_ |
| 17 | |
vbendeb | 6216f5a | 2010-06-21 08:40:26 -0700 | [diff] [blame] | 18 | #ifdef CHROMEOS_ENVIRONMENT |
| 19 | |
Randall Spangler | f302905 | 2010-06-16 13:42:58 -0700 | [diff] [blame] | 20 | #include <inttypes.h> /* For PRIu64 */ |
| 21 | #include <stdint.h> |
| 22 | #include <stdlib.h> |
| 23 | |
| 24 | #if defined(HAVE_ENDIAN_H) && defined(HAVE_LITTLE_ENDIAN) |
| 25 | #include <byteswap.h> |
| 26 | #include <memory.h> |
| 27 | #endif |
| 28 | |
vbendeb | 3ecaf77 | 2010-06-24 16:19:53 -0700 | [diff] [blame] | 29 | #else |
| 30 | #include "biosincludes.h" |
| 31 | #endif |
| 32 | |
| 33 | #ifndef _MSC_VER |
| 34 | #define __pragma(...) |
| 35 | #endif |
| 36 | |
| 37 | #if defined (CHROMEOS_ENVIRONMENT) || defined (TARGET_TEST_MODE) |
| 38 | |
Randall Spangler | beb5bae | 2010-06-21 16:33:26 -0700 | [diff] [blame] | 39 | /* 64-bit operations, for platforms where they need to be function calls */ |
| 40 | #define UINT64_RSHIFT(v, shiftby) (((uint64_t)(v)) >> (shiftby)) |
| 41 | #define UINT64_MULT32(v, multby) (((uint64_t)(v)) * ((uint32_t)(multby))) |
| 42 | |
vbendeb | 6216f5a | 2010-06-21 08:40:26 -0700 | [diff] [blame] | 43 | #endif |
Randall Spangler | f302905 | 2010-06-16 13:42:58 -0700 | [diff] [blame] | 44 | |
| 45 | #endif /* VBOOT_REFERENCE_SYSINCLUDES_H_ */ |