Moved basic types to their own headers

This commit is contained in:
2021-04-06 18:36:49 -05:00
parent 603a1a9dcc
commit f19fdac444
4 changed files with 37 additions and 10 deletions

View File

@@ -1,15 +1,8 @@
#ifndef SYSTYPES_H #ifndef SYSTYPES_H
#define SYSTYPES_H #define SYSTYPES_H
#include <stdint.h> #include "types/physaddr.h"
#include <stddef.h> #include "types/status.h"
#include "types/handle.h"
#if defined __i386__ || __arm__
typedef uint32_t physaddr_t;
#elif defined __x86_64__ || __aarch64__
typedef uint64_t physaddr_t;
#else
typedef uint64_t physaddr_t;
#endif
#endif #endif

8
src/types/handle.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef HANDLE_H
#define HANDLE_H
#include <stdint.h>
typedef uint64_t handle_t;
#endif

15
src/types/physaddr.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef PHYSADDR_H
#define PHYSADDR_H
#include <stdint.h>
#include <stddef.h>
#if defined __i386__ || __arm__
typedef uint32_t physaddr_t;
#elif defined __x86_64__ || __aarch64__
typedef uint64_t physaddr_t;
#else
typedef uint64_t physaddr_t;
#endif
#endif

11
src/types/status.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef STATUS_H
#define STATUS_H
enum class Status
{
OK = 0,
BadArgument,
NoMemory
};
#endif