2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2004-11-19 23:16:20 +03:00
|
|
|
* Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _KERNEL_ARCH_CPU_H
|
|
|
|
#define _KERNEL_ARCH_CPU_H
|
|
|
|
|
2003-10-08 01:56:32 +04:00
|
|
|
|
2004-10-21 05:41:29 +04:00
|
|
|
#include <OS.h>
|
2003-10-08 01:56:32 +04:00
|
|
|
#include <boot/kernel_args.h>
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2004-10-20 04:33:06 +04:00
|
|
|
#define PAGE_ALIGN(x) (((x) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1))
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-10-21 05:41:29 +04:00
|
|
|
status_t arch_cpu_preboot_init(kernel_args *args);
|
|
|
|
status_t arch_cpu_init(kernel_args *args);
|
|
|
|
status_t arch_cpu_init_post_vm(kernel_args *args);
|
2004-11-19 23:16:20 +03:00
|
|
|
status_t arch_cpu_shutdown(bool reboot);
|
2002-07-18 18:15:47 +04:00
|
|
|
|
2004-10-20 04:33:06 +04:00
|
|
|
void arch_cpu_invalidate_TLB_range(addr_t start, addr_t end);
|
|
|
|
void arch_cpu_invalidate_TLB_list(addr_t pages[], int num_pages);
|
2002-07-09 16:24:59 +04:00
|
|
|
void arch_cpu_global_TLB_invalidate(void);
|
|
|
|
|
2004-10-21 05:41:29 +04:00
|
|
|
status_t arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr_t *faultHandler);
|
|
|
|
ssize_t arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr_t *faultHandler);
|
|
|
|
status_t arch_cpu_user_memset(void *s, char c, size_t count, addr_t *faultHandler);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2002-07-18 18:15:47 +04:00
|
|
|
void arch_cpu_idle(void);
|
2003-10-17 16:53:45 +04:00
|
|
|
void arch_cpu_sync_icache(void *address, size_t length);
|
2002-07-18 18:15:47 +04:00
|
|
|
|
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 */
|