interface, time

This commit is contained in:
aramya 2023-07-01 16:36:00 +01:00
parent f4deea5298
commit 498512fe0d
2 changed files with 67 additions and 0 deletions

47
entry/ofw/interface.c Normal file
View File

@ -0,0 +1,47 @@
#include <ofw.h>
extern void (*ofw)();
void* interpret(char* cmd, ...)
{
}
void* set_callback(void* addr)
{
struct
{
char* service;
int32_t n_args;
int32_t n_rets;
void* arg;
void* ret;
} ofw_arg;
SERVICE("set-callback", 13, 1, 1);
ofw_arg.arg = addr;
ofw(&ofw_arg);
return ofw_arg.ret;
}
void set_symbol_lookup(void* sym_to_value, void* value_to_sym)
{
struct
{
char* service;
int32_t n_args;
int32_t n_rets;
void* arg1;
void* arg2;
} ofw_arg;
SERVICE("set-symbol-lookup", 17, 2, 0);
ofw_arg.arg1 = sym_to_value;
ofw_arg.arg2 = value_to_sym;
ofw(&ofw_arg);
}

20
entry/ofw/time.c Normal file
View File

@ -0,0 +1,20 @@
#include <ofw.h>
extern void (*ofw)();
int32_t milliseconds(void)
{
struct
{
char* service;
int32_t n_args;
int32_t n_rets;
int32_t ret;
} ofw_arg;
SERVICE("milliseconds", 13, 0, 1);
ofw(&ofw_arg);
return ofw_arg.ret;
}