Use macro wrappers for device op prototypes
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <Flanterm/src/flanterm.h>
|
||||
#include <Flanterm/src/flanterm_backends/fb.h>
|
||||
#include <device/def_device_op.h>
|
||||
#include <device/device.h>
|
||||
#include <device/terminal.h>
|
||||
#include <libk/std.h>
|
||||
@@ -19,10 +20,7 @@ void ft_free (void* ptr, size_t size) {
|
||||
free (ptr);
|
||||
}
|
||||
|
||||
bool terminal_init (struct device* device, void* arg, struct proc* proc,
|
||||
struct reschedule_ctx* rctx) {
|
||||
(void)arg, (void)device, (void)proc, (void)rctx;
|
||||
|
||||
DEFINE_DEVICE_INIT (terminal_init) {
|
||||
struct limine_framebuffer_response* fb_r = limine_framebuffer_request.response;
|
||||
struct limine_framebuffer* fb = fb_r->framebuffers[0];
|
||||
|
||||
@@ -34,14 +32,9 @@ bool terminal_init (struct device* device, void* arg, struct proc* proc,
|
||||
return true;
|
||||
}
|
||||
|
||||
void terminal_fini (struct device* device, struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
(void)device, (void)proc, (void)rctx;
|
||||
}
|
||||
|
||||
int terminal_putstr (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)a2, (void)a3, (void)a4, (void)device, (void)rctx;
|
||||
DEFINE_DEVICE_FINI (terminal_fini) {}
|
||||
|
||||
DEFINE_DEVICE_OP (terminal_putstr) {
|
||||
if (!(proc->procgroup->capabilities & PROC_CAP_TERMINAL))
|
||||
return -ST_PERMISSION_ERROR;
|
||||
|
||||
@@ -56,10 +49,7 @@ int terminal_putstr (struct device* device, struct proc* proc, struct reschedule
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int terminal_dimensions (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)a3, (void)a4, (void)device;
|
||||
|
||||
DEFINE_DEVICE_OP (terminal_dimensions) {
|
||||
if (a1 == NULL || a2 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user