LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
runner.cxx File Reference

(7c4d7d1 userspace/term: change eyecandy inclusion to use objcopy instead of xxd)

#include <iostream>
#include <dlfcn.h>
#include <stdarg.h>
#include <gtest/gtest.h>
#include "lfostest.h"
#include "../allocator.h"
+ Include dependency graph for runner.cxx:

Go to the source code of this file.

Macros

#define _TESTRUNNER
 
#define LFOS_API   __attribute__((visibility("default")))
 

Functions

LFOS_API void panic_message (const char *message)
 
LFOS_API void panic ()
 
LFOS_API int ksnprintf (char *buffer, int buffer_size, const char *format,...)
 
int main (int argc, char *argv[])
 

Variables

LFOS_API uint64_t scheduler_current_process = 0
 
LFOS_API allocator_t kernel_alloc
 

Macro Definition Documentation

◆ _TESTRUNNER

#define _TESTRUNNER

Definition at line 1 of file runner.cxx.

◆ LFOS_API

#define LFOS_API   __attribute__((visibility("default")))

Definition at line 9 of file runner.cxx.

Function Documentation

◆ ksnprintf()

LFOS_API int ksnprintf ( char *  buffer,
int  buffer_size,
const char *  format,
  ... 
)

Definition at line 40 of file runner.cxx.

References format, va_end, and va_start.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 50 of file runner.cxx.

References error.

◆ panic()

LFOS_API void panic ( void  )

Definition at line 36 of file runner.cxx.

References panic_message().

+ Here is the call graph for this function:

◆ panic_message()

LFOS_API void panic_message ( const char *  message)

Definition at line 31 of file runner.cxx.

References message.

+ Here is the caller graph for this function:

Variable Documentation

◆ kernel_alloc

LFOS_API allocator_t kernel_alloc
Initial value:
.alloc = [](allocator_t* alloc, size_t size) -> void* {
alloc->tag += size;
uint8_t* data = new uint8_t[size + sizeof(size_t)];
(reinterpret_cast<size_t*>(data))[0] = size;
return data+sizeof(size_t);
},
.dealloc = [](allocator_t* alloc, void* ptr) -> void {
size_t* data = reinterpret_cast<size_t*>(reinterpret_cast<uint8_t*>(ptr) - sizeof(size_t));
alloc->tag -= *data;
delete[] data;
}
}
uint64_t size_t
Definition arch.h:18
unsigned char uint8_t
Definition arch.h:5
allocator_t * alloc
uint16_t size
Size of the loaded file.
Definition loader.h:5
uint64_t tag
Definition allocator.h:12
void *(* alloc)(struct allocator *alloc, size_t size)
Definition allocator.h:9

Definition at line 17 of file runner.cxx.

◆ scheduler_current_process

LFOS_API uint64_t scheduler_current_process = 0

Definition at line 15 of file runner.cxx.