2002-07-09 16:24:59 +04:00
|
|
|
/*
|
|
|
|
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
** Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-18 18:15:47 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _KERNEL_ARCH_CPU_H
|
|
|
|
#define _KERNEL_ARCH_CPU_H
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <ktypes.h>
|
2003-05-03 18:12:16 +04:00
|
|
|
#include <boot/stage2.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1))
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int arch_cpu_preboot_init(kernel_args *ka);
|
|
|
|
int arch_cpu_init(kernel_args *ka);
|
|
|
|
int arch_cpu_init2(kernel_args *ka);
|
|
|
|
void reboot(void);
|
2002-07-18 18:15:47 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
void arch_cpu_invalidate_TLB_range(addr start, addr end);
|
|
|
|
void arch_cpu_invalidate_TLB_list(addr pages[], int num_pages);
|
|
|
|
void arch_cpu_global_TLB_invalidate(void);
|
|
|
|
|
2003-05-13 19:23:17 +04:00
|
|
|
int arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr *faultHandler);
|
|
|
|
int arch_cpu_user_strcpy(char *to, const char *from, addr *faultHandler);
|
|
|
|
int arch_cpu_user_strncpy(char *to, const char *from, size_t size, addr *faultHandler);
|
|
|
|
int arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr *faultHandler);
|
|
|
|
int arch_cpu_user_memset(void *s, char c, size_t count, addr *faultHandler);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-07-18 18:15:47 +04:00
|
|
|
void arch_cpu_idle(void);
|
|
|
|
|
2003-05-13 19:23:17 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <arch_cpu.h>
|
|
|
|
|
|
|
|
#endif /* _KERNEL_ARCH_CPU_H */
|
|
|
|
|