• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2 /**********************************************************
3  *
4  * Copyright (c) 2024 Broadcom.
5  * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
6  *
7  **********************************************************/
8 #ifndef VM_BASIC_TYPES_H
9 #define VM_BASIC_TYPES_H
10 
11 #include <stdbool.h>
12 #include <stdint.h>
13 
14 typedef uint32_t uint32;
15 typedef int32_t int32;
16 typedef uint64_t uint64;
17 typedef uint16_t uint16;
18 typedef int16_t int16;
19 typedef uint8_t uint8;
20 typedef int8_t int8;
21 
22 typedef uint64 PA;
23 typedef uint32 PPN;
24 typedef uint32 PPN32;
25 typedef uint64 PPN64;
26 
27 typedef bool Bool;
28 
29 #define MAX_UINT64 UINT64_MAX
30 #define MAX_UINT32 UINT32_MAX
31 #define MAX_UINT16 UINT16_MAX
32 
33 #define CONST64U(x) x##ULL
34 
35 #ifndef MBYTES_SHIFT
36 #define MBYTES_SHIFT 20
37 #endif
38 #ifndef MBYTES_2_BYTES
39 #define MBYTES_2_BYTES(_nbytes) ((uint64)(_nbytes) << MBYTES_SHIFT)
40 #endif
41 
42 #define INLINE inline
43 
44 #endif
45