Files
haiku-beta6/headers/private/kernel/cpu.h
T

56 lines
1.1 KiB
C
Raw Normal View History

/*
* Copyright 2002-2005, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2002, Travis Geiselbrecht. All rights reserved.
* Distributed under the terms of the NewOS License.
*/
2002-07-09 12:24:59 +00:00
#ifndef _KERNEL_CPU_H
#define _KERNEL_CPU_H
#include <smp.h>
#include <timer.h>
struct kernel_args;
2002-07-09 12:24:59 +00:00
/* CPU local data structure */
2002-07-09 12:24:59 +00:00
typedef union cpu_ent {
struct {
int cpu_num;
// thread.c: used to force a reschedule at quantum expiration time
2002-07-09 12:24:59 +00:00
int preempted;
timer quantum_timer;
2002-07-09 12:24:59 +00:00
} info;
// ToDo: align manually on CPU cache lines if possible
2002-07-09 12:24:59 +00:00
uint32 align[16];
} cpu_ent;
/**
* Defined in core/cpu.c
*/
extern cpu_ent cpu[MAX_BOOT_CPUS];
#ifdef __cplusplus
extern "C" {
#endif
2002-07-09 12:24:59 +00:00
status_t cpu_preboot_init(struct kernel_args *args);
status_t cpu_init(struct kernel_args *args);
status_t cpu_init_post_vm(struct kernel_args *args);
2002-07-09 12:24:59 +00:00
cpu_ent *get_cpu_struct(void);
extern inline cpu_ent *get_cpu_struct(void) { return &cpu[smp_get_current_cpu()]; }
void _user_clear_caches(void *address, size_t length, uint32 flags);
2002-07-09 12:24:59 +00:00
#ifdef __cplusplus
}
#endif
#endif /* _KERNEL_CPU_H */