xref: /haiku/headers/private/kernel/arch/cpu.h (revision 48c68671a20d8226c206dbaa30b5eccbd0ae3237)
1 /*
2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 #ifndef _KERNEL_ARCH_CPU_H
6 #define _KERNEL_ARCH_CPU_H
7 
8 
9 #include <kernel.h>
10 #include <ktypes.h>
11 #include <boot/kernel_args.h>
12 
13 
14 #define PAGE_ALIGN(x) (((x) + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1))
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 int arch_cpu_preboot_init(kernel_args *ka);
21 int arch_cpu_init(kernel_args *ka);
22 int arch_cpu_init2(kernel_args *ka);
23 void reboot(void);
24 
25 void arch_cpu_invalidate_TLB_range(addr start, addr end);
26 void arch_cpu_invalidate_TLB_list(addr pages[], int num_pages);
27 void arch_cpu_global_TLB_invalidate(void);
28 
29 int arch_cpu_user_memcpy(void *to, const void *from, size_t size, addr *faultHandler);
30 int arch_cpu_user_strlcpy(char *to, const char *from, size_t size, addr *faultHandler);
31 int arch_cpu_user_memset(void *s, char c, size_t count, addr *faultHandler);
32 
33 void arch_cpu_idle(void);
34 void arch_cpu_sync_icache(void *address, size_t length);
35 
36 #ifdef __cplusplus
37 }
38 #endif
39 
40 #include <arch_cpu.h>
41 
42 #endif /* _KERNEL_ARCH_CPU_H */
43 
44