2023-10-21 21:23:51 +03:00
|
|
|
|
/**
|
|
|
|
|
* sys.c
|
|
|
|
|
* Файл с функциями управления системой
|
|
|
|
|
*
|
|
|
|
|
* Этот файл содержит имплементацию функций для управления системой
|
|
|
|
|
*/
|
|
|
|
|
|
2023-10-21 20:27:23 +03:00
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include <sys.h>
|
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
module_info_t *current_module;
|
|
|
|
|
|
2023-10-21 20:27:23 +03:00
|
|
|
|
void sys_init( ) {}
|
|
|
|
|
|
|
|
|
|
framebuffer_t *sys_alloc_framebuffer( ) {
|
|
|
|
|
return (framebuffer_t *)0;
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
void sys_free_framebuffer(framebuffer_t *frame) {
|
|
|
|
|
frame->reserved = 0;
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
void sys_exit(int code) {
|
|
|
|
|
current_module->err_code = code;
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
|
|
|
|
int sys_get_error( ) {
|
2023-10-31 19:06:56 +03:00
|
|
|
|
return current_module->err_code;
|
2023-10-21 20:27:23 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
sys_info_t *sys_get_info( ) {
|
|
|
|
|
return &(sys_info_t){ .reserved = 0 };
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
module_info_t *sys_get_module(uint64_t module_id) {
|
|
|
|
|
return (module_info_t *)module_id;
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
uint64_t sys_new_thread(uint64_t func) {
|
|
|
|
|
return func;
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
int sys_delete_thread(uint64_t thread_id) {
|
|
|
|
|
return thread_id;
|
2023-10-21 20:27:23 +03:00
|
|
|
|
}
|
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
time_t sys_get_time( ) {
|
|
|
|
|
return (time_t){ .year = 2023, .month = 10, .day = 31, .second = 1 };
|
|
|
|
|
}
|
2023-10-21 20:27:23 +03:00
|
|
|
|
|
2023-10-31 19:06:56 +03:00
|
|
|
|
// void sys_set_alarm(time_t time, func_t func) {}
|