powerpc-ofw-boot/src/ofw/mem.c

48 lines
858 B
C
Raw Normal View History

2023-07-01 15:03:33 +00:00
#include <ofw.h>
extern void (*ofw)();
2023-07-02 10:43:32 +00:00
void* ofw_claim(void* virt, int32_t size, int32_t align)
2023-07-01 15:03:33 +00:00
{
struct
{
char* service;
int32_t n_args;
int32_t n_rets;
void* arg1;
int32_t arg2;
int32_t arg3;
void* ret;
} ofw_arg;
SERVICE("claim", 6, 3, 1);
ofw_arg.arg1 = virt;
ofw_arg.arg2 = size;
ofw_arg.arg3 = align;
ofw(&ofw_arg);
return ofw_arg.ret;
}
2023-07-02 10:43:32 +00:00
void ofw_release(void* virt, int32_t size)
2023-07-01 15:03:33 +00:00
{
struct
{
char* service;
int32_t n_args;
int32_t n_rets;
void* arg1;
int32_t arg2;
} ofw_arg;
SERVICE("release", 8, 2, 0);
ofw_arg.arg1 = virt;
ofw_arg.arg2 = size;
ofw(&ofw_arg);
}