mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[util] Replace kutil with util
Now that kutil has no kernel-specific code in it anymore, it can actually be linked to by anything, so I'm renaming it 'util'. Also, I've tried to unify the way that the system libraries from src/libraries are #included using <> instead of "". Other small change: util::bip_buffer got a spinlock to guard against state corruption.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#include <uefi/boot_services.h>
|
#include <uefi/boot_services.h>
|
||||||
#include <uefi/types.h>
|
#include <uefi/types.h>
|
||||||
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "kutil/no_construct.h"
|
|
||||||
#include "allocator.h"
|
#include "allocator.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "init_args.h"
|
#include "init_args.h"
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
namespace boot {
|
namespace boot {
|
||||||
|
|
||||||
kutil::no_construct<memory::allocator> __g_alloc_storage;
|
util::no_construct<memory::allocator> __g_alloc_storage;
|
||||||
memory::allocator &g_alloc = __g_alloc_storage.value;
|
memory::allocator &g_alloc = __g_alloc_storage.value;
|
||||||
|
|
||||||
namespace memory {
|
namespace memory {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module("boot",
|
|||||||
kind = "exe",
|
kind = "exe",
|
||||||
output = "boot.efi",
|
output = "boot.efi",
|
||||||
targets = [ "boot" ],
|
targets = [ "boot" ],
|
||||||
deps = [ "cpu", "elf", "kutil" ],
|
deps = [ "cpu", "elf", "util" ],
|
||||||
sources = [
|
sources = [
|
||||||
"allocator.cpp",
|
"allocator.cpp",
|
||||||
"console.cpp",
|
"console.cpp",
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
#include <uefi/boot_services.h>
|
#include <uefi/boot_services.h>
|
||||||
#include <uefi/runtime_services.h>
|
#include <uefi/runtime_services.h>
|
||||||
#include <uefi/types.h>
|
#include <uefi/types.h>
|
||||||
#include <kutil/no_construct.h>
|
|
||||||
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
enum j6_vm_flags {
|
enum j6_vm_flags {
|
||||||
#define VM_FLAG(name, v) j6_vm_flag_ ## name = v,
|
#define VM_FLAG(name, v) j6_vm_flag_ ## name = v,
|
||||||
#include "j6/tables/vm_flags.inc"
|
#include <j6/tables/vm_flags.inc>
|
||||||
#undef VM_FLAG
|
#undef VM_FLAG
|
||||||
j6_vm_flag_MAX
|
j6_vm_flag_MAX
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/// Types used in process and thread initialization
|
/// Types used in process and thread initialization
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
enum j6_init_type { // `value` is a:
|
enum j6_init_type { // `value` is a:
|
||||||
j6_init_handle_self, // Handle to the system
|
j6_init_handle_self, // Handle to the system
|
||||||
|
|||||||
@@ -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/tables/object_types.inc"
|
#include <j6/tables/object_types.inc>
|
||||||
#undef OBJECT_TYPE
|
#undef OBJECT_TYPE
|
||||||
|
|
||||||
j6_object_type_max
|
j6_object_type_max
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "enum_bitfields.h"
|
#include <util/misc.h>
|
||||||
#include "kutil/misc.h"
|
#include <enum_bitfields.h>
|
||||||
|
|
||||||
struct acpi_table_header
|
struct acpi_table_header
|
||||||
{
|
{
|
||||||
@@ -22,7 +22,7 @@ struct acpi_table_header
|
|||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
#define TABLE_HEADER(signature) \
|
#define TABLE_HEADER(signature) \
|
||||||
static constexpr uint32_t type_id = kutil::byteswap(signature); \
|
static constexpr uint32_t type_id = util::byteswap(signature); \
|
||||||
acpi_table_header header;
|
acpi_table_header header;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
#include "printf/printf.h"
|
|
||||||
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
#include "printf/printf.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
|
||||||
|
|
||||||
const char digits[] = "0123456789abcdef";
|
const char digits[] = "0123456789abcdef";
|
||||||
|
|
||||||
static kutil::no_construct<console> __g_console_storage;
|
static util::no_construct<console> __g_console_storage;
|
||||||
console &g_console = __g_console_storage.value;
|
console &g_console = __g_console_storage.value;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/// \file device_manager.h
|
/// \file device_manager.h
|
||||||
/// The device manager definition
|
/// The device manager definition
|
||||||
#include "kutil/vector.h"
|
|
||||||
|
#include <util/vector.h>
|
||||||
|
|
||||||
#include "apic.h"
|
#include "apic.h"
|
||||||
#include "hpet.h"
|
#include "hpet.h"
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
@@ -79,7 +81,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Get the list of APIC ids for other CPUs
|
/// Get the list of APIC ids for other CPUs
|
||||||
inline const kutil::vector<uint8_t> & get_apic_ids() const { return m_apic_ids; }
|
inline const util::vector<uint8_t> & get_apic_ids() const { return m_apic_ids; }
|
||||||
|
|
||||||
/// Get the LAPIC base address
|
/// Get the LAPIC base address
|
||||||
/// \returns The physical base address of the local apic registers
|
/// \returns The physical base address of the local apic registers
|
||||||
@@ -150,18 +152,18 @@ private:
|
|||||||
|
|
||||||
uintptr_t m_lapic_base;
|
uintptr_t m_lapic_base;
|
||||||
|
|
||||||
kutil::vector<ioapic> m_ioapics;
|
util::vector<ioapic> m_ioapics;
|
||||||
kutil::vector<hpet> m_hpets;
|
util::vector<hpet> m_hpets;
|
||||||
kutil::vector<uint8_t> m_apic_ids;
|
util::vector<uint8_t> m_apic_ids;
|
||||||
kutil::vector<apic_nmi> m_nmis;
|
util::vector<apic_nmi> m_nmis;
|
||||||
kutil::vector<irq_override> m_overrides;
|
util::vector<irq_override> m_overrides;
|
||||||
|
|
||||||
kutil::vector<pci_group> m_pci;
|
util::vector<pci_group> m_pci;
|
||||||
kutil::vector<pci_device> m_devices;
|
util::vector<pci_device> m_devices;
|
||||||
|
|
||||||
kutil::vector<endpoint*> m_irqs;
|
util::vector<endpoint*> m_irqs;
|
||||||
|
|
||||||
kutil::vector<block_device *> m_blockdevs;
|
util::vector<block_device *> m_blockdevs;
|
||||||
|
|
||||||
static device_manager s_instance;
|
static device_manager s_instance;
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ bsf(uint64_t v)
|
|||||||
size_t
|
size_t
|
||||||
frame_allocator::allocate(size_t count, uintptr_t *address)
|
frame_allocator::allocate(size_t count, uintptr_t *address)
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
for (long i = m_count - 1; i >= 0; --i) {
|
for (long i = m_count - 1; i >= 0; --i) {
|
||||||
frame_block &block = m_blocks[i];
|
frame_block &block = m_blocks[i];
|
||||||
@@ -80,7 +80,7 @@ frame_allocator::allocate(size_t count, uintptr_t *address)
|
|||||||
void
|
void
|
||||||
frame_allocator::free(uintptr_t address, size_t count)
|
frame_allocator::free(uintptr_t address, size_t count)
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
kassert(address % frame_size == 0, "Trying to free a non page-aligned frame!");
|
kassert(address % frame_size == 0, "Trying to free a non page-aligned frame!");
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ frame_allocator::free(uintptr_t address, size_t count)
|
|||||||
void
|
void
|
||||||
frame_allocator::used(uintptr_t address, size_t count)
|
frame_allocator::used(uintptr_t address, size_t count)
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
kassert(address % frame_size == 0, "Trying to mark a non page-aligned frame!");
|
kassert(address % frame_size == 0, "Trying to mark a non page-aligned frame!");
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/// Allocator for physical memory frames
|
/// Allocator for physical memory frames
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "kutil/spinlock.h"
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
namespace init {
|
namespace init {
|
||||||
@@ -46,7 +46,7 @@ private:
|
|||||||
frame_block *m_blocks;
|
frame_block *m_blocks;
|
||||||
size_t m_count;
|
size_t m_count;
|
||||||
|
|
||||||
kutil::spinlock m_lock;
|
util::spinlock m_lock;
|
||||||
|
|
||||||
frame_allocator() = delete;
|
frame_allocator() = delete;
|
||||||
frame_allocator(const frame_allocator &) = delete;
|
frame_allocator(const frame_allocator &) = delete;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
@@ -22,7 +22,7 @@ static constexpr uint8_t tss_index = 6; // Note that this takes TWO GDT en
|
|||||||
// The BSP's GDT is initialized _before_ global constructors are called,
|
// The BSP's GDT is initialized _before_ global constructors are called,
|
||||||
// so we don't want it to have a global constructor, lest it overwrite
|
// so we don't want it to have a global constructor, lest it overwrite
|
||||||
// the previous initialization.
|
// the previous initialization.
|
||||||
static kutil::no_construct<GDT> __g_bsp_gdt_storage;
|
static util::no_construct<GDT> __g_bsp_gdt_storage;
|
||||||
GDT &g_bsp_gdt = __g_bsp_gdt_storage.value;
|
GDT &g_bsp_gdt = __g_bsp_gdt_storage.value;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "kutil/util.h"
|
|
||||||
|
#include <util/util.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "heap_allocator.h"
|
#include "heap_allocator.h"
|
||||||
@@ -81,7 +82,7 @@ heap_allocator::allocate(size_t length)
|
|||||||
if (length == 0)
|
if (length == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
unsigned order = kutil::log2(total);
|
unsigned order = util::log2(total);
|
||||||
if (order < min_order)
|
if (order < min_order)
|
||||||
order = min_order;
|
order = min_order;
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ heap_allocator::allocate(size_t length)
|
|||||||
if (order > max_order)
|
if (order > max_order)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
mem_header *header = pop_free(order);
|
mem_header *header = pop_free(order);
|
||||||
header->set_used(true);
|
header->set_used(true);
|
||||||
@@ -106,7 +107,7 @@ heap_allocator::free(void *p)
|
|||||||
kassert(addr >= m_start && addr < m_end,
|
kassert(addr >= m_start && addr < m_end,
|
||||||
"Attempt to free non-heap pointer");
|
"Attempt to free non-heap pointer");
|
||||||
|
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
mem_header *header = reinterpret_cast<mem_header *>(p);
|
mem_header *header = reinterpret_cast<mem_header *>(p);
|
||||||
header -= 1; // p points after the header
|
header -= 1; // p points after the header
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
/// A buddy allocator for a memory heap
|
/// A buddy allocator for a memory heap
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "kutil/spinlock.h"
|
|
||||||
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
|
|
||||||
/// Allocator for a given heap range
|
/// Allocator for a given heap range
|
||||||
@@ -56,7 +57,7 @@ protected:
|
|||||||
mem_header *m_free[max_order - min_order + 1];
|
mem_header *m_free[max_order - min_order + 1];
|
||||||
size_t m_allocated_size;
|
size_t m_allocated_size;
|
||||||
|
|
||||||
kutil::spinlock m_lock;
|
util::spinlock m_lock;
|
||||||
|
|
||||||
heap_allocator(const heap_allocator &) = delete;
|
heap_allocator(const heap_allocator &) = delete;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "idt.h"
|
#include "idt.h"
|
||||||
@@ -23,7 +23,7 @@ extern "C" {
|
|||||||
// The BSP's IDT is initialized _before_ global constructors are called,
|
// The BSP's IDT is initialized _before_ global constructors are called,
|
||||||
// so we don't want it to have a global constructor, lest it overwrite
|
// so we don't want it to have a global constructor, lest it overwrite
|
||||||
// the previous initialization.
|
// the previous initialization.
|
||||||
static kutil::no_construct<IDT> __g_bsp_idt_storage;
|
static util::no_construct<IDT> __g_bsp_idt_storage;
|
||||||
IDT &g_bsp_idt = __g_bsp_idt_storage.value;
|
IDT &g_bsp_idt = __g_bsp_idt_storage.value;
|
||||||
void (*__nmi_handler)();
|
void (*__nmi_handler)();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ kernel = module("kernel",
|
|||||||
default = True,
|
default = True,
|
||||||
output = "jsix.elf",
|
output = "jsix.elf",
|
||||||
targets = [ "kernel" ],
|
targets = [ "kernel" ],
|
||||||
deps = [ "kutil", "cpu" ],
|
deps = [ "util", "cpu" ],
|
||||||
includes = [ "." ],
|
includes = [ "." ],
|
||||||
sources = [
|
sources = [
|
||||||
"apic.cpp",
|
"apic.cpp",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
@@ -13,7 +13,7 @@ static uint8_t log_buffer[0x10000];
|
|||||||
// The logger is initialized _before_ global constructors are called,
|
// The logger is initialized _before_ global constructors are called,
|
||||||
// so that we can start log output immediately. Keep its constructor
|
// so that we can start log output immediately. Keep its constructor
|
||||||
// from being called here so as to not overwrite the previous initialization.
|
// from being called here so as to not overwrite the previous initialization.
|
||||||
static kutil::no_construct<log::logger> __g_logger_storage;
|
static util::no_construct<log::logger> __g_logger_storage;
|
||||||
log::logger &g_logger = __g_logger_storage.value;
|
log::logger &g_logger = __g_logger_storage.value;
|
||||||
|
|
||||||
static const uint8_t level_colors[] = {0x07, 0x07, 0x0f, 0x0b, 0x09};
|
static const uint8_t level_colors[] = {0x07, 0x07, 0x0f, 0x0b, 0x09};
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "kutil/constexpr_hash.h"
|
#include <util/constexpr_hash.h>
|
||||||
#include "printf/printf.h"
|
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
#include "printf/printf.h"
|
||||||
|
|
||||||
namespace logs {
|
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 "j6/tables/log_areas.inc"
|
#include <j6/tables/log_areas.inc>
|
||||||
#undef LOG
|
#undef LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,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 "j6/tables/log_areas.inc"
|
#include <j6/tables/log_areas.inc>
|
||||||
#undef LOG
|
#undef LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ logger::output(level severity, area_t area, const char *fmt, va_list args)
|
|||||||
header->bytes +=
|
header->bytes +=
|
||||||
vsnprintf(header->message, sizeof(buffer) - sizeof(entry), fmt, args);
|
vsnprintf(header->message, sizeof(buffer) - sizeof(entry), fmt, args);
|
||||||
|
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
if (m_immediate) {
|
if (m_immediate) {
|
||||||
buffer[header->bytes] = 0;
|
buffer[header->bytes] = 0;
|
||||||
@@ -117,7 +117,7 @@ logger::output(level severity, area_t area, const char *fmt, va_list args)
|
|||||||
size_t
|
size_t
|
||||||
logger::get_entry(void *buffer, size_t size)
|
logger::get_entry(void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
void *out;
|
void *out;
|
||||||
size_t out_size = m_buffer.get_block(&out);
|
size_t out_size = m_buffer.get_block(&out);
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "kutil/bip_buffer.h"
|
#include <util/bip_buffer.h>
|
||||||
#include "kutil/spinlock.h"
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
@@ -110,8 +110,8 @@ private:
|
|||||||
|
|
||||||
uint8_t m_sequence;
|
uint8_t m_sequence;
|
||||||
|
|
||||||
kutil::bip_buffer m_buffer;
|
util::bip_buffer m_buffer;
|
||||||
kutil::spinlock m_lock;
|
util::spinlock m_lock;
|
||||||
|
|
||||||
static logger *s_log;
|
static logger *s_log;
|
||||||
static const char *s_level_names[static_cast<unsigned>(level::max)];
|
static const char *s_level_names[static_cast<unsigned>(level::max)];
|
||||||
@@ -129,6 +129,6 @@ extern log::logger &g_logger;
|
|||||||
|
|
||||||
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 "j6/tables/log_areas.inc"
|
#include <j6/tables/log_areas.inc>
|
||||||
#undef LOG
|
#undef LOG
|
||||||
} // namespace logs
|
} // namespace logs
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "kernel_args.h"
|
#include <util/vector.h>
|
||||||
#include "kernel_memory.h"
|
#include <kernel_args.h>
|
||||||
|
#include <kernel_memory.h>
|
||||||
|
|
||||||
#include "apic.h"
|
#include "apic.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
@@ -54,7 +55,7 @@ void memory_initialize_pre_ctors(init::args &kargs);
|
|||||||
void memory_initialize_post_ctors(init::args &kargs);
|
void memory_initialize_post_ctors(init::args &kargs);
|
||||||
void load_init_server(init::program &program, uintptr_t modules_address);
|
void load_init_server(init::program &program, uintptr_t modules_address);
|
||||||
|
|
||||||
unsigned start_aps(lapic &apic, const kutil::vector<uint8_t> &ids, void *kpml4);
|
unsigned start_aps(lapic &apic, const util::vector<uint8_t> &ids, void *kpml4);
|
||||||
|
|
||||||
void
|
void
|
||||||
init_console()
|
init_console()
|
||||||
@@ -190,7 +191,7 @@ kernel_main(init::args *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
start_aps(lapic &apic, const kutil::vector<uint8_t> &ids, void *kpml4)
|
start_aps(lapic &apic, const util::vector<uint8_t> &ids, void *kpml4)
|
||||||
{
|
{
|
||||||
using memory::frame_size;
|
using memory::frame_size;
|
||||||
using memory::kernel_stack_pages;
|
using memory::kernel_stack_pages;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "kernel_args.h"
|
#include <j6/init.h>
|
||||||
#include "j6/init.h"
|
#include <util/no_construct.h>
|
||||||
|
#include <kernel_args.h>
|
||||||
#include "enum_bitfields.h"
|
#include <enum_bitfields.h>
|
||||||
#include "kutil/no_construct.h"
|
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "device_manager.h"
|
#include "device_manager.h"
|
||||||
@@ -39,16 +38,16 @@ extern "C" uintptr_t initialize_main_user_stack();
|
|||||||
// These objects are initialized _before_ global constructors are called,
|
// These objects are initialized _before_ global constructors are called,
|
||||||
// so we don't want them to have global constructors at all, lest they
|
// so we don't want them to have global constructors at all, lest they
|
||||||
// overwrite the previous initialization.
|
// overwrite the previous initialization.
|
||||||
static kutil::no_construct<heap_allocator> __g_kernel_heap_storage;
|
static util::no_construct<heap_allocator> __g_kernel_heap_storage;
|
||||||
heap_allocator &g_kernel_heap = __g_kernel_heap_storage.value;
|
heap_allocator &g_kernel_heap = __g_kernel_heap_storage.value;
|
||||||
|
|
||||||
static kutil::no_construct<frame_allocator> __g_frame_allocator_storage;
|
static util::no_construct<frame_allocator> __g_frame_allocator_storage;
|
||||||
frame_allocator &g_frame_allocator = __g_frame_allocator_storage.value;
|
frame_allocator &g_frame_allocator = __g_frame_allocator_storage.value;
|
||||||
|
|
||||||
static kutil::no_construct<vm_area_untracked> __g_kernel_heap_area_storage;
|
static util::no_construct<vm_area_untracked> __g_kernel_heap_area_storage;
|
||||||
vm_area_untracked &g_kernel_heap_area = __g_kernel_heap_area_storage.value;
|
vm_area_untracked &g_kernel_heap_area = __g_kernel_heap_area_storage.value;
|
||||||
|
|
||||||
static kutil::no_construct<vm_area_guarded> __g_kernel_stacks_storage;
|
static util::no_construct<vm_area_guarded> __g_kernel_stacks_storage;
|
||||||
vm_area_guarded &g_kernel_stacks = __g_kernel_stacks_storage.value;
|
vm_area_guarded &g_kernel_stacks = __g_kernel_stacks_storage.value;
|
||||||
|
|
||||||
vm_area_guarded g_kernel_buffers {
|
vm_area_guarded g_kernel_buffers {
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
/// \file channel.h
|
/// \file channel.h
|
||||||
/// Definition of channel objects and related functions
|
/// Definition of channel objects and related functions
|
||||||
|
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "kutil/bip_buffer.h"
|
#include <util/bip_buffer.h>
|
||||||
|
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
|
|
||||||
/// Channels are bi-directional means of sending messages
|
/// Channels are bi-directional means of sending messages
|
||||||
@@ -45,5 +46,5 @@ protected:
|
|||||||
private:
|
private:
|
||||||
size_t m_len;
|
size_t m_len;
|
||||||
uintptr_t m_data;
|
uintptr_t m_data;
|
||||||
kutil::bip_buffer m_buffer;
|
util::bip_buffer m_buffer;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
/// \file endpoint.h
|
/// \file endpoint.h
|
||||||
/// Definition of endpoint kobject types
|
/// Definition of endpoint kobject types
|
||||||
|
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
|
#include <util/vector.h>
|
||||||
|
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
|
|
||||||
/// Endpoints are objects that enable synchronous message-passing IPC
|
/// Endpoints are objects that enable synchronous message-passing IPC
|
||||||
@@ -64,5 +66,5 @@ private:
|
|||||||
|
|
||||||
j6_status_t do_message_copy(const thread_data &sender, thread_data &receiver);
|
j6_status_t do_message_copy(const thread_data &sender, thread_data &receiver);
|
||||||
|
|
||||||
kutil::vector<thread_data> m_blocked;
|
util::vector<thread_data> m_blocked;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
/// \file kobject.h
|
/// \file kobject.h
|
||||||
/// Definition of base type for user-interactable kernel objects
|
/// Definition of base type for user-interactable kernel objects
|
||||||
|
|
||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
#include "kutil/vector.h"
|
#include <util/vector.h>
|
||||||
|
|
||||||
class thread;
|
class thread;
|
||||||
|
|
||||||
@@ -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/tables/object_types.inc"
|
#include <j6/tables/object_types.inc>
|
||||||
#undef OBJECT_TYPE
|
#undef OBJECT_TYPE
|
||||||
|
|
||||||
max
|
max
|
||||||
@@ -96,5 +96,5 @@ private:
|
|||||||
uint16_t m_handle_count;
|
uint16_t m_handle_count;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
kutil::vector<thread*> m_blocked_threads;
|
util::vector<thread*> m_blocked_threads;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
// This object is initialized _before_ global constructors are called,
|
// This object is initialized _before_ global constructors are called,
|
||||||
// so we don't want it to have a global constructor at all, lest it
|
// so we don't want it to have a global constructor at all, lest it
|
||||||
// overwrite the previous initialization.
|
// overwrite the previous initialization.
|
||||||
static kutil::no_construct<process> __g_kernel_process_storage;
|
static util::no_construct<process> __g_kernel_process_storage;
|
||||||
process &g_kernel_process = __g_kernel_process_storage.value;
|
process &g_kernel_process = __g_kernel_process_storage.value;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
/// \file process.h
|
/// \file process.h
|
||||||
/// Definition of process kobject types
|
/// Definition of process kobject types
|
||||||
|
|
||||||
#include "kutil/map.h"
|
#include <util/map.h>
|
||||||
#include "kutil/vector.h"
|
#include <util/vector.h>
|
||||||
|
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
#include "page_table.h"
|
#include "page_table.h"
|
||||||
#include "vm_space.h"
|
#include "vm_space.h"
|
||||||
@@ -88,8 +89,8 @@ private:
|
|||||||
|
|
||||||
vm_space m_space;
|
vm_space m_space;
|
||||||
|
|
||||||
kutil::vector<thread*> m_threads;
|
util::vector<thread*> m_threads;
|
||||||
kutil::map<j6_handle_t, kobject*> m_handles;
|
util::map<j6_handle_t, kobject*> m_handles;
|
||||||
j6_handle_t m_next_handle;
|
j6_handle_t m_next_handle;
|
||||||
|
|
||||||
enum class state : uint8_t { running, exited };
|
enum class state : uint8_t { running, exited };
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
/// \file thread.h
|
/// \file thread.h
|
||||||
/// Definition of thread kobject types
|
/// Definition of thread kobject types
|
||||||
|
|
||||||
#include "kutil/linked_list.h"
|
#include <util/linked_list.h>
|
||||||
|
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
|
|
||||||
struct page_table;
|
struct page_table;
|
||||||
@@ -29,7 +30,7 @@ struct TCB
|
|||||||
uint64_t last_ran;
|
uint64_t last_ran;
|
||||||
};
|
};
|
||||||
|
|
||||||
using tcb_list = kutil::linked_list<TCB>;
|
using tcb_list = util::linked_list<TCB>;
|
||||||
using tcb_node = tcb_list::item_type;
|
using tcb_node = tcb_list::item_type;
|
||||||
|
|
||||||
class thread :
|
class thread :
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "enum_bitfields.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/signals.h"
|
#include <util/vector.h>
|
||||||
#include "kutil/vector.h"
|
#include <enum_bitfields.h>
|
||||||
|
|
||||||
#include "kernel_memory.h"
|
#include "kernel_memory.h"
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
@@ -18,7 +18,7 @@ class vm_space;
|
|||||||
enum class vm_flags : uint32_t
|
enum class vm_flags : uint32_t
|
||||||
{
|
{
|
||||||
#define VM_FLAG(name, v) name = v,
|
#define VM_FLAG(name, v) name = v,
|
||||||
#include "j6/tables/vm_flags.inc"
|
#include <j6/tables/vm_flags.inc>
|
||||||
#undef VM_FLAG
|
#undef VM_FLAG
|
||||||
driver_mask = 0x000fffff, ///< flags allowed via syscall for drivers
|
driver_mask = 0x000fffff, ///< flags allowed via syscall for drivers
|
||||||
user_mask = 0x0000ffff, ///< flags allowed via syscall for non-drivers
|
user_mask = 0x0000ffff, ///< flags allowed via syscall for non-drivers
|
||||||
@@ -74,7 +74,7 @@ protected:
|
|||||||
|
|
||||||
size_t m_size;
|
size_t m_size;
|
||||||
vm_flags m_flags;
|
vm_flags m_flags;
|
||||||
kutil::vector<vm_space*> m_spaces;
|
util::vector<vm_space*> m_spaces;
|
||||||
|
|
||||||
// Initial static space for m_spaces - most areas will never grow
|
// Initial static space for m_spaces - most areas will never grow
|
||||||
// beyond this size, so avoid allocations
|
// beyond this size, so avoid allocations
|
||||||
@@ -165,7 +165,7 @@ public:
|
|||||||
virtual bool get_page(uintptr_t offset, uintptr_t &phys) override;
|
virtual bool get_page(uintptr_t offset, uintptr_t &phys) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
kutil::vector<uintptr_t> m_cache;
|
util::vector<uintptr_t> m_cache;
|
||||||
uintptr_t m_start;
|
uintptr_t m_start;
|
||||||
size_t m_pages;
|
size_t m_pages;
|
||||||
uintptr_t m_next;
|
uintptr_t m_next;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using level = page_table::level;
|
|||||||
|
|
||||||
free_page_header * page_table::s_page_cache = nullptr;
|
free_page_header * page_table::s_page_cache = nullptr;
|
||||||
size_t page_table::s_cache_count = 0;
|
size_t page_table::s_cache_count = 0;
|
||||||
kutil::spinlock page_table::s_lock;
|
util::spinlock page_table::s_lock;
|
||||||
constexpr size_t page_table::entry_sizes[4];
|
constexpr size_t page_table::entry_sizes[4];
|
||||||
|
|
||||||
|
|
||||||
@@ -180,7 +180,7 @@ page_table::get_table_page()
|
|||||||
free_page_header *page = nullptr;
|
free_page_header *page = nullptr;
|
||||||
|
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock(s_lock);
|
util::scoped_lock lock(s_lock);
|
||||||
|
|
||||||
if (!s_cache_count)
|
if (!s_cache_count)
|
||||||
fill_table_page_cache();
|
fill_table_page_cache();
|
||||||
@@ -199,7 +199,7 @@ page_table::get_table_page()
|
|||||||
void
|
void
|
||||||
page_table::free_table_page(page_table *pt)
|
page_table::free_table_page(page_table *pt)
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock(s_lock);
|
util::scoped_lock lock(s_lock);
|
||||||
free_page_header *page =
|
free_page_header *page =
|
||||||
reinterpret_cast<free_page_header*>(pt);
|
reinterpret_cast<free_page_header*>(pt);
|
||||||
page->next = s_page_cache;
|
page->next = s_page_cache;
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
/// Helper structures for dealing with page tables.
|
/// Helper structures for dealing with page tables.
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "enum_bitfields.h"
|
#include <util/spinlock.h>
|
||||||
#include "kernel_memory.h"
|
#include <enum_bitfields.h>
|
||||||
#include "kutil/spinlock.h"
|
#include <kernel_memory.h>
|
||||||
|
|
||||||
struct free_page_header;
|
struct free_page_header;
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ struct page_table
|
|||||||
|
|
||||||
static free_page_header *s_page_cache; ///< Cache of free pages to use for tables
|
static free_page_header *s_page_cache; ///< Cache of free pages to use for tables
|
||||||
static size_t s_cache_count; ///< Number of pages in s_page_cache
|
static size_t s_cache_count; ///< Number of pages in s_page_cache
|
||||||
static kutil::spinlock s_lock; ///< Lock for shared page cache
|
static util::spinlock s_lock; ///< Lock for shared page cache
|
||||||
|
|
||||||
/// Get an entry in the page table as a page_table pointer
|
/// Get an entry in the page table as a page_table pointer
|
||||||
/// \arg i Index of the entry in this page table
|
/// \arg i Index of the entry in this page table
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ panic = module("panic.serial",
|
|||||||
kind = "exe",
|
kind = "exe",
|
||||||
output = "panic.serial.elf",
|
output = "panic.serial.elf",
|
||||||
targets = [ "kernel" ],
|
targets = [ "kernel" ],
|
||||||
deps = [ "kutil", "elf", "kernel" ],
|
deps = [ "util", "elf", "kernel" ],
|
||||||
sources = [
|
sources = [
|
||||||
"display.cpp",
|
"display.cpp",
|
||||||
"entry.s",
|
"entry.s",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <j6/init.h>
|
#include <j6/init.h>
|
||||||
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
#include "apic.h"
|
#include "apic.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
@@ -34,7 +35,7 @@ struct run_queue
|
|||||||
|
|
||||||
uint64_t last_promotion = 0;
|
uint64_t last_promotion = 0;
|
||||||
uint64_t last_steal = 0;
|
uint64_t last_steal = 0;
|
||||||
kutil::spinlock lock;
|
util::spinlock lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
scheduler::scheduler(unsigned cpus) :
|
scheduler::scheduler(unsigned cpus) :
|
||||||
@@ -97,7 +98,7 @@ scheduler::start()
|
|||||||
run_queue &queue = m_run_queues[cpu.index];
|
run_queue &queue = m_run_queues[cpu.index];
|
||||||
|
|
||||||
{
|
{
|
||||||
kutil::scoped_lock lock {queue.lock};
|
util::scoped_lock lock {queue.lock};
|
||||||
|
|
||||||
process *kp = &process::kernel_process();
|
process *kp = &process::kernel_process();
|
||||||
thread *idle = thread::create_idle_thread(*kp, max_priority, cpu.rsp0);
|
thread *idle = thread::create_idle_thread(*kp, max_priority, cpu.rsp0);
|
||||||
@@ -119,7 +120,7 @@ scheduler::add_thread(TCB *t)
|
|||||||
{
|
{
|
||||||
cpu_data &cpu = current_cpu();
|
cpu_data &cpu = current_cpu();
|
||||||
run_queue &queue = m_run_queues[cpu.index];
|
run_queue &queue = m_run_queues[cpu.index];
|
||||||
kutil::scoped_lock lock {queue.lock};
|
util::scoped_lock lock {queue.lock};
|
||||||
|
|
||||||
queue.blocked.push_back(static_cast<tcb_node*>(t));
|
queue.blocked.push_back(static_cast<tcb_node*>(t));
|
||||||
t->time_left = quantum(t->priority);
|
t->time_left = quantum(t->priority);
|
||||||
@@ -221,14 +222,14 @@ scheduler::steal_work(cpu_data &cpu)
|
|||||||
{
|
{
|
||||||
// Lock this cpu's queue for the whole time while we modify it
|
// Lock this cpu's queue for the whole time while we modify it
|
||||||
run_queue &my_queue = m_run_queues[cpu.index];
|
run_queue &my_queue = m_run_queues[cpu.index];
|
||||||
kutil::scoped_lock my_queue_lock {my_queue.lock};
|
util::scoped_lock my_queue_lock {my_queue.lock};
|
||||||
|
|
||||||
const unsigned count = m_run_queues.count();
|
const unsigned count = m_run_queues.count();
|
||||||
for (unsigned i = 0; i < count; ++i) {
|
for (unsigned i = 0; i < count; ++i) {
|
||||||
if (i == cpu.index) continue;
|
if (i == cpu.index) continue;
|
||||||
|
|
||||||
run_queue &other_queue = m_run_queues[i];
|
run_queue &other_queue = m_run_queues[i];
|
||||||
kutil::scoped_lock other_queue_lock {other_queue.lock};
|
util::scoped_lock other_queue_lock {other_queue.lock};
|
||||||
|
|
||||||
size_t stolen = 0;
|
size_t stolen = 0;
|
||||||
|
|
||||||
@@ -263,7 +264,7 @@ scheduler::schedule()
|
|||||||
// We need to explicitly lock/unlock here instead of
|
// We need to explicitly lock/unlock here instead of
|
||||||
// using a scoped lock, because the scope doesn't "end"
|
// using a scoped lock, because the scope doesn't "end"
|
||||||
// for the current thread until it gets scheduled again
|
// for the current thread until it gets scheduled again
|
||||||
kutil::spinlock::waiter waiter;
|
util::spinlock::waiter waiter;
|
||||||
queue.lock.acquire(&waiter);
|
queue.lock.acquire(&waiter);
|
||||||
|
|
||||||
queue.current->time_left = remaining;
|
queue.current->time_left = remaining;
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
/// The task scheduler and related definitions
|
/// The task scheduler and related definitions
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "kutil/spinlock.h"
|
#include <util/vector.h>
|
||||||
#include "kutil/vector.h"
|
|
||||||
|
|
||||||
namespace kernel {
|
namespace kernel {
|
||||||
namespace args {
|
namespace args {
|
||||||
@@ -92,7 +91,7 @@ private:
|
|||||||
|
|
||||||
process *m_kernel_process;
|
process *m_kernel_process;
|
||||||
|
|
||||||
kutil::vector<run_queue> m_run_queues;
|
util::vector<run_queue> m_run_queues;
|
||||||
|
|
||||||
// TODO: lol a real clock
|
// TODO: lol a real clock
|
||||||
uint64_t m_clock = 0;
|
uint64_t m_clock = 0;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "interrupts.h"
|
#include "interrupts.h"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
// This object is initialized _before_ global constructors are called,
|
// This object is initialized _before_ global constructors are called,
|
||||||
// so we don't want it to have global constructors at all, lest it
|
// so we don't want it to have global constructors at all, lest it
|
||||||
// overwrite the previous initialization.
|
// overwrite the previous initialization.
|
||||||
static kutil::no_construct<serial_port> __g_com1_storage;
|
static util::no_construct<serial_port> __g_com1_storage;
|
||||||
serial_port &g_com1 = __g_com1_storage.value;
|
serial_port &g_com1 = __g_com1_storage.value;
|
||||||
|
|
||||||
constexpr size_t fifo_size = 64;
|
constexpr size_t fifo_size = 64;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/// Declarations related to serial ports.
|
/// Declarations related to serial ports.
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "kutil/bip_buffer.h"
|
#include <util/bip_buffer.h>
|
||||||
|
|
||||||
class serial_port
|
class serial_port
|
||||||
{
|
{
|
||||||
@@ -22,8 +22,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool m_writing;
|
bool m_writing;
|
||||||
uint16_t m_port;
|
uint16_t m_port;
|
||||||
kutil::bip_buffer m_out_buffer;
|
util::bip_buffer m_out_buffer;
|
||||||
kutil::bip_buffer m_in_buffer;
|
util::bip_buffer m_in_buffer;
|
||||||
|
|
||||||
void do_read();
|
void do_read();
|
||||||
void do_write();
|
void do_write();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// vim: ft=cpp
|
// vim: ft=cpp
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
struct cpu_state;
|
struct cpu_state;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "objects/channel.h"
|
#include "objects/channel.h"
|
||||||
#include "syscalls/helpers.h"
|
#include "syscalls/helpers.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "objects/endpoint.h"
|
#include "objects/endpoint.h"
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
/// \file syscalls/helpers.h
|
/// \file syscalls/helpers.h
|
||||||
/// Utility functions for use in syscall handler implementations
|
/// Utility functions for use in syscall handler implementations
|
||||||
|
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "objects/kobject.h"
|
#include "objects/kobject.h"
|
||||||
#include "objects/process.h"
|
#include "objects/process.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
#include <util/vector.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@@ -50,7 +51,7 @@ kobject_wait(j6_handle_t handle, j6_signal_t mask, j6_signal_t *sigs)
|
|||||||
j6_status_t
|
j6_status_t
|
||||||
kobject_wait_many(j6_handle_t * handles, size_t handles_count, uint64_t mask, j6_handle_t * handle, uint64_t * signals)
|
kobject_wait_many(j6_handle_t * handles, size_t handles_count, uint64_t mask, j6_handle_t * handle, uint64_t * signals)
|
||||||
{
|
{
|
||||||
kutil::vector<kobject*> objects {uint32_t(handles_count)};
|
util::vector<kobject*> objects {uint32_t(handles_count)};
|
||||||
|
|
||||||
for (unsigned i = 0; i < handles_count; ++i) {
|
for (unsigned i = 0; i < handles_count; ++i) {
|
||||||
j6_handle_t h = handles[i];
|
j6_handle_t h = handles[i];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "objects/process.h"
|
#include "objects/process.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "device_manager.h"
|
#include "device_manager.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "objects/process.h"
|
#include "objects/process.h"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "objects/process.h"
|
#include "objects/process.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "kutil/no_construct.h"
|
#include <util/no_construct.h>
|
||||||
|
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
// The BSP's TSS is initialized _before_ global constructors are called,
|
// The BSP's TSS is initialized _before_ global constructors are called,
|
||||||
// so we don't want it to have a global constructor, lest it overwrite
|
// so we don't want it to have a global constructor, lest it overwrite
|
||||||
// the previous initialization.
|
// the previous initialization.
|
||||||
static kutil::no_construct<TSS> __g_bsp_tss_storage;
|
static util::no_construct<TSS> __g_bsp_tss_storage;
|
||||||
TSS &g_bsp_tss = __g_bsp_tss_storage.value;
|
TSS &g_bsp_tss = __g_bsp_tss_storage.value;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ void
|
|||||||
vm_space::page_in(const vm_area &vma, uintptr_t offset, uintptr_t phys, size_t count)
|
vm_space::page_in(const vm_area &vma, uintptr_t offset, uintptr_t phys, size_t count)
|
||||||
{
|
{
|
||||||
using memory::frame_size;
|
using memory::frame_size;
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
uintptr_t base = 0;
|
uintptr_t base = 0;
|
||||||
if (!find_vma(vma, base))
|
if (!find_vma(vma, base))
|
||||||
@@ -198,7 +198,7 @@ void
|
|||||||
vm_space::clear(const vm_area &vma, uintptr_t offset, size_t count, bool free)
|
vm_space::clear(const vm_area &vma, uintptr_t offset, size_t count, bool free)
|
||||||
{
|
{
|
||||||
using memory::frame_size;
|
using memory::frame_size;
|
||||||
kutil::scoped_lock lock {m_lock};
|
util::scoped_lock lock {m_lock};
|
||||||
|
|
||||||
uintptr_t base = 0;
|
uintptr_t base = 0;
|
||||||
if (!find_vma(vma, base))
|
if (!find_vma(vma, base))
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
/// Structure for tracking a range of virtual memory addresses
|
/// Structure for tracking a range of virtual memory addresses
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "enum_bitfields.h"
|
|
||||||
#include "kutil/spinlock.h"
|
#include <util/spinlock.h>
|
||||||
#include "kutil/vector.h"
|
#include <util/vector.h>
|
||||||
|
#include <enum_bitfields.h>
|
||||||
|
|
||||||
#include "page_table.h"
|
#include "page_table.h"
|
||||||
|
|
||||||
class process;
|
class process;
|
||||||
@@ -129,9 +131,9 @@ private:
|
|||||||
int compare(const struct area &o) const;
|
int compare(const struct area &o) const;
|
||||||
bool operator==(const struct area &o) const;
|
bool operator==(const struct area &o) const;
|
||||||
};
|
};
|
||||||
kutil::vector<area> m_areas;
|
util::vector<area> m_areas;
|
||||||
|
|
||||||
kutil::spinlock m_lock;
|
util::spinlock m_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
is_bitfield(vm_space::fault_type);
|
is_bitfield(vm_space::fault_type);
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
#define assert(x) ((void)0)
|
#define assert(x) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "kutil/bip_buffer.h"
|
#include <util/bip_buffer.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
bip_buffer::bip_buffer() :
|
bip_buffer::bip_buffer() :
|
||||||
m_start_a(0),
|
m_start_a(0),
|
||||||
@@ -30,6 +30,8 @@ bip_buffer::bip_buffer(uint8_t *buffer, size_t size) :
|
|||||||
|
|
||||||
size_t bip_buffer::reserve(size_t size, void **area)
|
size_t bip_buffer::reserve(size_t size, void **area)
|
||||||
{
|
{
|
||||||
|
scoped_lock lock {m_lock};
|
||||||
|
|
||||||
if (m_size_r) {
|
if (m_size_r) {
|
||||||
*area = nullptr;
|
*area = nullptr;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -66,6 +68,8 @@ size_t bip_buffer::reserve(size_t size, void **area)
|
|||||||
|
|
||||||
void bip_buffer::commit(size_t size)
|
void bip_buffer::commit(size_t size)
|
||||||
{
|
{
|
||||||
|
scoped_lock lock {m_lock};
|
||||||
|
|
||||||
assert(size <= m_size_r && "Tried to commit more than reserved");
|
assert(size <= m_size_r && "Tried to commit more than reserved");
|
||||||
|
|
||||||
if (m_start_r == m_start_a + m_size_a) {
|
if (m_start_r == m_start_a + m_size_a) {
|
||||||
@@ -82,12 +86,16 @@ void bip_buffer::commit(size_t size)
|
|||||||
|
|
||||||
size_t bip_buffer::get_block(void **area) const
|
size_t bip_buffer::get_block(void **area) const
|
||||||
{
|
{
|
||||||
|
scoped_lock lock {m_lock};
|
||||||
|
|
||||||
*area = m_size_a ? &m_buffer[m_start_a] : nullptr;
|
*area = m_size_a ? &m_buffer[m_start_a] : nullptr;
|
||||||
return m_size_a;
|
return m_size_a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bip_buffer::consume(size_t size)
|
void bip_buffer::consume(size_t size)
|
||||||
{
|
{
|
||||||
|
scoped_lock lock {m_lock};
|
||||||
|
|
||||||
assert(size <= m_size_a && "Consumed more bytes than exist in A");
|
assert(size <= m_size_a && "Consumed more bytes than exist in A");
|
||||||
if (size >= m_size_a) {
|
if (size >= m_size_a) {
|
||||||
m_size_a = m_size_b;
|
m_size_a = m_size_b;
|
||||||
@@ -99,4 +107,4 @@ void bip_buffer::consume(size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace kutil {
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
|
||||||
class bip_buffer
|
class bip_buffer
|
||||||
{
|
{
|
||||||
@@ -52,8 +54,10 @@ private:
|
|||||||
size_t m_size_b;
|
size_t m_size_b;
|
||||||
size_t m_size_r;
|
size_t m_size_r;
|
||||||
|
|
||||||
|
mutable spinlock m_lock;
|
||||||
|
|
||||||
const size_t m_buffer_size;
|
const size_t m_buffer_size;
|
||||||
uint8_t * const m_buffer;
|
uint8_t * const m_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
constexpr static const uint8_t pearson_hash_table[256] = {
|
constexpr static const uint8_t pearson_hash_table[256] = {
|
||||||
0x76,0x07,0xbe,0x47,0xcf,0x41,0x0a,0xe8,0x01,0x5c,0x9f,0xc5,0x24,0x63,0x9a,0x85,
|
0x76,0x07,0xbe,0x47,0xcf,0x41,0x0a,0xe8,0x01,0x5c,0x9f,0xc5,0x24,0x63,0x9a,0x85,
|
||||||
@@ -34,9 +34,9 @@ constexpr inline uint32_t djb_hash_32(const char *s, int off = 0) {
|
|||||||
return !s[off] ? 5381 : (djb_hash_32(s, off+1)*33) ^ s[off];
|
return !s[off] ? 5381 : (djb_hash_32(s, off+1)*33) ^ s[off];
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
|
|
||||||
constexpr inline uint8_t operator "" _h (const char *s, size_t len) {
|
constexpr inline uint8_t operator "" _h (const char *s, size_t len) {
|
||||||
return kutil::pearson_hash_8(s, static_cast<uint8_t>(len & 0xff));
|
return util::pearson_hash_8(s, static_cast<uint8_t>(len & 0xff));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
constexpr uint64_t fnv_64_prime = 0x100000001b3ull;
|
constexpr uint64_t fnv_64_prime = 0x100000001b3ull;
|
||||||
constexpr uint64_t fnv1a_64_init = 0xcbf29ce484222325ull;
|
constexpr uint64_t fnv1a_64_init = 0xcbf29ce484222325ull;
|
||||||
@@ -40,4 +40,4 @@ inline uint64_t hash(const T &v) {
|
|||||||
template <> inline uint64_t hash<uint64_t>(const uint64_t &i) { return i; }
|
template <> inline uint64_t hash<uint64_t>(const uint64_t &i) { return i; }
|
||||||
template <> inline uint64_t hash<const char *>(const char * const &s) { return hash_string(s); }
|
template <> inline uint64_t hash<const char *>(const char * const &s) { return hash_string(s); }
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
/// A generic templatized linked list.
|
/// A generic templatized linked list.
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
template <typename T> class linked_list;
|
template <typename T> class linked_list;
|
||||||
|
|
||||||
@@ -346,4 +346,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -14,11 +14,12 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "kutil/hash.h"
|
|
||||||
#include "kutil/vector.h"
|
|
||||||
#include "kutil/util.h"
|
|
||||||
|
|
||||||
namespace kutil {
|
#include <util/hash.h>
|
||||||
|
#include <util/vector.h>
|
||||||
|
#include <util/util.h>
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
|
||||||
/// Templated equality check to allow overriding
|
/// Templated equality check to allow overriding
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -290,4 +291,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
constexpr uint32_t
|
constexpr uint32_t
|
||||||
byteswap(uint32_t x)
|
byteswap(uint32_t x)
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
/// \file no_construct.h
|
/// \file no_construct.h
|
||||||
/// Tools for creating objects witout running constructors
|
/// Tools for creating objects witout running constructors
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
/// Helper template for creating objects witout running constructors
|
/// Helper template for creating objects witout running constructors
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@@ -13,4 +13,4 @@ union no_construct
|
|||||||
~no_construct() {}
|
~no_construct() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
/// An MCS based spinlock
|
/// An MCS based spinlock
|
||||||
class spinlock
|
class spinlock
|
||||||
@@ -43,4 +43,4 @@ private:
|
|||||||
spinlock::waiter m_waiter;
|
spinlock::waiter m_waiter;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
/// \file util.h
|
/// \file util.h
|
||||||
/// Utility functions used in other kutil code
|
/// Utility functions used in other util code
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
// Get the base-2 logarithm of i
|
// Get the base-2 logarithm of i
|
||||||
inline unsigned log2(uint64_t i) {
|
inline unsigned log2(uint64_t i) {
|
||||||
@@ -5,9 +5,10 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "kutil/util.h"
|
|
||||||
|
|
||||||
namespace kutil {
|
#include <util/util.h>
|
||||||
|
|
||||||
|
namespace util {
|
||||||
|
|
||||||
/// A dynamic array.
|
/// A dynamic array.
|
||||||
template <typename T, typename S = uint32_t>
|
template <typename T, typename S = uint32_t>
|
||||||
@@ -292,4 +293,4 @@ private:
|
|||||||
T *m_elements;
|
T *m_elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "kutil/spinlock.h"
|
#include <util/spinlock.h>
|
||||||
|
|
||||||
namespace kutil {
|
namespace util {
|
||||||
|
|
||||||
static constexpr int memorder = __ATOMIC_SEQ_CST;
|
static constexpr int memorder = __ATOMIC_SEQ_CST;
|
||||||
|
|
||||||
@@ -43,4 +43,4 @@ spinlock::release(waiter *w)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace kutil
|
} // namespace util
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# vim: ft=python
|
# vim: ft=python
|
||||||
|
|
||||||
module("kutil",
|
module("util",
|
||||||
kind = "lib",
|
kind = "lib",
|
||||||
includes = [ "include" ],
|
includes = [ "include" ],
|
||||||
sources = [
|
sources = [
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "j6/init.h"
|
#include <j6/init.h>
|
||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/flags.h"
|
#include <j6/flags.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/syscalls.h"
|
#include <j6/syscalls.h>
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
|
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "enum_bitfields.h"
|
|
||||||
#include "elf/file.h"
|
#include <elf/file.h>
|
||||||
#include "elf/headers.h"
|
#include <elf/headers.h>
|
||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/flags.h"
|
#include <j6/flags.h>
|
||||||
#include "j6/syscalls.h"
|
#include <j6/syscalls.h>
|
||||||
#include "init_args.h"
|
#include <init_args.h>
|
||||||
|
#include <enum_bitfields.h>
|
||||||
|
|
||||||
using kernel::init::module_flags;
|
using kernel::init::module_flags;
|
||||||
using kernel::init::module_program;
|
using kernel::init::module_program;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "init_args.h"
|
|
||||||
#include "j6/syscalls.h"
|
#include <j6/syscalls.h>
|
||||||
|
#include <init_args.h>
|
||||||
|
|
||||||
#include "loader.h"
|
#include "loader.h"
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/syscalls.h"
|
#include <j6/syscalls.h>
|
||||||
|
|
||||||
#include "modules.h"
|
#include "modules.h"
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
/// \file modules.h
|
/// \file modules.h
|
||||||
/// Routines for loading initial argument modules
|
/// Routines for loading initial argument modules
|
||||||
|
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
#include "init_args.h"
|
#include <init_args.h>
|
||||||
#include "pointer_manipulation.h"
|
#include <pointer_manipulation.h>
|
||||||
|
|
||||||
|
|
||||||
class module_iterator
|
class module_iterator
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "j6/types.h"
|
#include <j6/types.h>
|
||||||
#include "j6/errors.h"
|
#include <j6/errors.h>
|
||||||
#include "j6/flags.h"
|
#include <j6/flags.h>
|
||||||
#include "j6/signals.h"
|
#include <j6/signals.h>
|
||||||
#include "j6/syscalls.h"
|
#include <j6/syscalls.h>
|
||||||
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user