kernel: don't use typedef for enums or non-opaque structs

This commit is contained in:
2023-04-12 20:17:11 +01:00
parent 0d75e347e9
commit b6f8c1ccaa
51 changed files with 663 additions and 665 deletions

View File

@@ -2,9 +2,9 @@
#include <socks/object.h>
#include <socks/cpu.h>
static object_type_t thread_type = {
static struct object_type thread_type = {
.ob_name = "thread",
.ob_size = sizeof(thread_t),
.ob_size = sizeof(struct thread),
};
kern_status_t thread_object_type_init(void)
@@ -12,31 +12,31 @@ kern_status_t thread_object_type_init(void)
return object_type_register(&thread_type);
}
thread_t *thread_alloc(void)
struct thread *thread_alloc(void)
{
object_t *thread_obj = object_create(&thread_type);
struct object *thread_obj = object_create(&thread_type);
if (!thread_obj) {
return NULL;
}
thread_t *t = object_data(thread_obj);
struct thread *t = object_data(thread_obj);
memset(t, 0x00, sizeof *t);
return t;
}
void thread_free(thread_t *thr)
void thread_free(struct thread *thr)
{
}
thread_t *current_thread(void)
struct thread *current_thread(void)
{
cpu_data_t *cpu = get_this_cpu();
struct cpu_data *cpu = get_this_cpu();
if (!cpu) {
return NULL;
}
thread_t *out = cpu->c_current_thread;
struct thread *out = cpu->c_current_thread;
put_cpu(cpu);
return out;
}