1 /* 2 * types.h 3 * 4 * Created on: Jan 18, 2015 5 * Author: maord 6 */ 7 8 #ifndef A_MLXUTILS_INCLUDE_PUBLIC_TYPES_H_ 9 #define A_MLXUTILS_INCLUDE_PUBLIC_TYPES_H_ 10 #include <stdint.h> 11 //#include <errno.h> 12 #include <ipxe/pci.h> 13 14 #define MLX_SUCCESS 0 15 #define MLX_OUT_OF_RESOURCES (-1) 16 //(-ENOMEM) 17 #define MLX_INVALID_PARAMETER (-2) 18 //(-EINVAL) 19 #define MLX_UNSUPPORTED (-3) 20 //(-ENOSYS) 21 #define MLX_NOT_FOUND (-4) 22 23 #define MLX_FAILED (-5) 24 25 #undef TRUE 26 #define TRUE 1 27 #undef FALSE 28 #define FALSE !TRUE 29 30 typedef int mlx_status; 31 32 typedef uint8_t mlx_uint8; 33 typedef uint16_t mlx_uint16; 34 typedef uint32_t mlx_uint32; 35 typedef uint64_t mlx_uint64; 36 typedef unsigned long mlx_uintn; 37 38 typedef int8_t mlx_int8; 39 typedef int16_t mlx_int16;; 40 typedef int32_t mlx_int32; 41 typedef int64_t mlx_int64; 42 typedef uint8_t mlx_boolean; 43 44 typedef struct pci_device mlx_pci; 45 46 typedef size_t mlx_size; 47 48 typedef void mlx_void; 49 50 #define MAC_ADDR_LEN 6 51 typedef unsigned long mlx_physical_address; 52 typedef union { 53 struct { 54 uint32_t low; 55 uint32_t high; 56 } __attribute__ (( packed )); 57 uint8_t addr[MAC_ADDR_LEN]; 58 } mlx_mac_address; 59 60 #endif /* A_MLXUTILS_INCLUDE_PUBLIC_TYPES_H_ */ 61