stuff
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#include <zinnia/channel.h>
|
||||
#include <zinnia/handle.h>
|
||||
#include <zinnia/ipc/init.h>
|
||||
#include <zinnia/system.h>
|
||||
#include <common/compiler.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <uacpi/uacpi.h>
|
||||
|
||||
[[__format(printf, 1, 2)]]
|
||||
static void zn_printf(const char* msg, ...) {
|
||||
char buf[1024];
|
||||
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
int32_t len = vsnprintf(buf, sizeof(buf), msg, args);
|
||||
va_end(args);
|
||||
|
||||
zn_log(buf, len);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[], char* envp[]) {
|
||||
zn_printf("devd: starting...\n");
|
||||
zn_handle_t channel = getauxval(AT_INIT_HANDLE);
|
||||
|
||||
// while (true) {}
|
||||
uacpi_status status = uacpi_initialize(0);
|
||||
if (status != UACPI_STATUS_OK) {
|
||||
zn_printf("devd: uacpi_initialize failed: %s\n", uacpi_status_to_string(status));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
status = uacpi_namespace_load();
|
||||
if (status != UACPI_STATUS_OK) {
|
||||
zn_printf("devd: uacpi_namespace_load failed: %s\n", uacpi_status_to_string(status));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
uacpi_namespace_initialize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user