Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
core.h
Go to the documentation of this file.
1#ifndef __HAL__CPU__CORE_H__
2#define __HAL__CPU__CORE_H__
3
4#include "autoconf.h"
5#include "procc/scheduler.h"
6#include "procc/thread.h"
7#include "procc/workqueue.h"
8#include <type.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct __attribute__((aligned(64))) {
15 uint64_t canary;
16 uint8_t core_id;
17
19 uint64_t user_rsp;
20 int next_is_user;
21
22 boolean_t usleep_trigerred;
24 uint32_t workqueue_count;
25 thread_t* active_thread;
26
27
28 uint8_t _pad[2];
29 // cache line end
30
31 workqueue_t workqueue[VOXIA_MAX_WORKQUEUE_EACH_CORE];
33
34void update_core_gs(uint8_t id);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif // __HAL__CPU__CORE_H__
uint8_t get_current_core_cpuid()
struct thread thread_t
Definition thread.h:29
uint8_t _pad[64 -(sizeof(void *) *6+sizeof(size_t) *6+sizeof(spinlock_t)) % 64]
Definition kalloc.c:21
uint8_t vxGetActiveCoreCount()
Definition core.c:265
each_core_data * get_current_core_data()
Definition core.c:54
each_core_data
Definition core.h:32
each_core_data * vxGetCoreDataByCoreID(uint8_t core_id)
Definition core.c:62
void update_core_gs(uint8_t id)
Definition core.c:39
uintptr_t kernel_rsp
Definition thread.h:21
static scheduler_core_t scheduler[VOXIA_MAX_CORE]
Definition scheduler.c:17
struct scheduler_core scheduler_core_t
unsigned int uint32_t
Definition type.h:19
uint8_t boolean_t
Definition type.h:89
unsigned long uint64_t
Definition type.h:25
unsigned char uint8_t
Definition type.h:7
struct workqueue workqueue_t