[kernel] Move 'table' includes to j6/tables

Move all table-style include files that are part of the public kernel
interface to the j6/tables include path
This commit is contained in:
Justin C. Miller
2021-01-28 18:42:42 -08:00
parent 3aa909b917
commit c3dd65457d
15 changed files with 10 additions and 43 deletions

View File

@@ -1,13 +0,0 @@
#include "guids.h"
#define GUID(dw, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, name) \
EFI_GUID name __attribute__((section(".rodata"))) = {dw, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}
#include "guids.inc"
#undef GUID
int is_guid(EFI_GUID *a, EFI_GUID *b)
{
uint64_t *ai = (uint64_t *)a;
uint64_t *bi = (uint64_t *)b;
return ai[0] == bi[0] && ai[1] == bi[1];
}

View File

@@ -1,8 +0,0 @@
#pragma once
#include <efi/efi.h>
int is_guid(EFI_GUID *a, EFI_GUID *b);
#define GUID(dw, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, name) extern EFI_GUID name
#include "guids.inc"
#undef GUID

View File

@@ -1,11 +0,0 @@
GUID(0xeb9d2d30,0x2d88,0x11d3,0x9a,0x16,0x00,0x90,0x27,0x3f,0xc1,0x4d, guid_acpi1);
GUID(0x8868e871,0xe4f1,0x11d3,0xbc,0x22,0x00,0x80,0xc7,0x3c,0x88,0x81, guid_acpi2);
GUID(0x09576e92,0x6d3f,0x11d2,0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b, guid_file_info);
GUID(0x9042a9de,0x23dc,0x4a38,0x96,0xfb,0x7a,0xde,0xd0,0x80,0x51,0x6a, guid_gfx_out);
GUID(0x964e5b22,0x6459,0x11d2,0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b, guid_simple_filesystem);
GUID(0x09576e91,0x6d3f,0x11d2,0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b, guid_device_path);
GUID(0x8b843e20,0x8132,0x4852,0x90,0xcc,0x55,0x1a,0x4e,0x4a,0x7f,0x1c, guid_device_path_to_text);
GUID(0x10d0669c,0x9ec6,0x4268,0xbc,0x48,0xff,0x74,0x75,0x21,0xfe,0x07, guid_jsix_vendor);
// vim: ft=c

View File

@@ -38,7 +38,7 @@ typedef uint64_t j6_handle_t;
enum j6_object_type { enum j6_object_type {
#define OBJECT_TYPE( name, val ) j6_object_type_ ## name = val, #define OBJECT_TYPE( name, val ) j6_object_type_ ## name = val,
#include "j6/object_types.inc" #include "j6/tables/object_types.inc"
#undef OBJECT_TYPE #undef OBJECT_TYPE
j6_object_type_max j6_object_type_max

View File

@@ -17,7 +17,7 @@ public:
enum class type : uint16_t enum class type : uint16_t
{ {
#define OBJECT_TYPE( name, val ) name = val, #define OBJECT_TYPE( name, val ) name = val,
#include "j6/object_types.inc" #include "j6/tables/object_types.inc"
#undef OBJECT_TYPE #undef OBJECT_TYPE
max max

View File

@@ -69,7 +69,7 @@ syscall_enable()
syscall_names[id] = #name; \ syscall_names[id] = #name; \
static_assert( id <= num_calls, "Syscall " #name " has id > syscall::MAX" ); \ static_assert( id <= num_calls, "Syscall " #name " has id > syscall::MAX" ); \
log::debug(logs::syscall, "Enabling syscall 0x%02x as " #name , id); log::debug(logs::syscall, "Enabling syscall 0x%02x as " #name , id);
#include "syscalls.inc" #include "j6/tables/syscalls.inc"
#undef SYSCALL #undef SYSCALL
} }

View File

@@ -8,7 +8,7 @@ struct cpu_state;
enum class syscall : uint64_t enum class syscall : uint64_t
{ {
#define SYSCALL(id, name, ...) name = id, #define SYSCALL(id, name, ...) name = id,
#include "syscalls.inc" #include "j6/tables/syscalls.inc"
#undef SYSCALL #undef SYSCALL
// Maximum syscall id. If you change this, also change // Maximum syscall id. If you change this, also change
@@ -21,6 +21,6 @@ void syscall_enable();
namespace syscalls namespace syscalls
{ {
#define SYSCALL(id, name, ...) j6_status_t name (__VA_ARGS__); #define SYSCALL(id, name, ...) j6_status_t name (__VA_ARGS__);
#include "syscalls.inc" #include "j6/tables/syscalls.inc"
#undef SYSCALL #undef SYSCALL
} }

View File

@@ -1,4 +1,3 @@
%include "push_all.inc"
%include "tasking.inc" %include "tasking.inc"
; Make sure to keep MAX_SYSCALLS in sync with ; Make sure to keep MAX_SYSCALLS in sync with

View File

@@ -126,7 +126,7 @@ void fatal(area_t area, const char *fmt, ...);
namespace logs { namespace logs {
#define LOG(name, lvl) extern const log::area_t name; #define LOG(name, lvl) extern const log::area_t name;
#include "log_areas.inc" #include "j6/tables/log_areas.inc"
#undef LOG #undef LOG
} // namespace logs } // namespace logs

View File

@@ -9,7 +9,7 @@ namespace logs {
#define LOG(name, lvl) \ #define LOG(name, lvl) \
const log::area_t name = #name ## _h; \ const log::area_t name = #name ## _h; \
const char * name ## _name = #name; const char * name ## _name = #name;
#include "log_areas.inc" #include "j6/tables/log_areas.inc"
#undef LOG #undef LOG
} }
@@ -44,7 +44,7 @@ logger::logger(uint8_t *buffer, size_t size, logger::immediate_cb output) :
#define LOG(name, lvl) \ #define LOG(name, lvl) \
register_area(logs::name, logs::name ## _name, log::level::lvl); register_area(logs::name, logs::name ## _name, log::level::lvl);
#include "log_areas.inc" #include "j6/tables/log_areas.inc"
#undef LOG #undef LOG
} }

View File

@@ -25,4 +25,4 @@
%define SYSCALL(n, name, a, b, c, d) SYSCALL name, n %define SYSCALL(n, name, a, b, c, d) SYSCALL name, n
%define SYSCALL(n, name, a, b, c, d, e) SYSCALL name, n %define SYSCALL(n, name, a, b, c, d, e) SYSCALL name, n
%include "syscalls.inc" %include "j6/tables/syscalls.inc"

View File

@@ -7,7 +7,7 @@ extern "C" {
#endif #endif
#define SYSCALL(n, name, ...) j6_status_t _syscall_ ## name (__VA_ARGS__); #define SYSCALL(n, name, ...) j6_status_t _syscall_ ## name (__VA_ARGS__);
#include "syscalls.inc" #include "j6/tables/syscalls.inc"
#undef SYSCALL #undef SYSCALL
#ifdef __cplusplus #ifdef __cplusplus