mirror of
https://github.com/thamugadi/powerpc-ofw-boot.git
synced 2024-05-28 22:41:33 +00:00
interface, time
This commit is contained in:
parent
f4deea5298
commit
498512fe0d
47
entry/ofw/interface.c
Normal file
47
entry/ofw/interface.c
Normal 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
20
entry/ofw/time.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user