* Coding style cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33792 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2007, Axel Dörfler, [email protected]. All rights reserved.
|
* Copyright 2002-2009, Axel Dörfler, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||||
@@ -74,14 +74,14 @@
|
|||||||
|
|
||||||
// x86 features from cpuid eax 0x80000001, edx register (AMD)
|
// x86 features from cpuid eax 0x80000001, edx register (AMD)
|
||||||
// only care about the ones that are unique to this register
|
// only care about the ones that are unique to this register
|
||||||
#define IA32_FEATURE_AMD_EXT_SYSCALL (1<<11) // SYSCALL/SYSRET
|
#define IA32_FEATURE_AMD_EXT_SYSCALL (1 << 11) // SYSCALL/SYSRET
|
||||||
#define IA32_FEATURE_AMD_EXT_NX (1<<20) // no execute bit
|
#define IA32_FEATURE_AMD_EXT_NX (1 << 20) // no execute bit
|
||||||
#define IA32_FEATURE_AMD_EXT_MMXEXT (1<<22) // mmx extensions
|
#define IA32_FEATURE_AMD_EXT_MMXEXT (1 << 22) // mmx extensions
|
||||||
#define IA32_FEATURE_AMD_EXT_FFXSR (1<<25) // fast FXSAVE/FXRSTOR
|
#define IA32_FEATURE_AMD_EXT_FFXSR (1 << 25) // fast FXSAVE/FXRSTOR
|
||||||
#define IA32_FEATURE_AMD_EXT_RDTSCP (1<<27) // rdtscp instruction
|
#define IA32_FEATURE_AMD_EXT_RDTSCP (1 << 27) // rdtscp instruction
|
||||||
#define IA32_FEATURE_AMD_EXT_LONG (1<<29) // long mode
|
#define IA32_FEATURE_AMD_EXT_LONG (1 << 29) // long mode
|
||||||
#define IA32_FEATURE_AMD_EXT_3DNOWEXT (1<<30) // 3DNow! extensions
|
#define IA32_FEATURE_AMD_EXT_3DNOWEXT (1 << 30) // 3DNow! extensions
|
||||||
#define IA32_FEATURE_AMD_EXT_3DNOW (1<<31) // 3DNow!
|
#define IA32_FEATURE_AMD_EXT_3DNOW (1 << 31) // 3DNow!
|
||||||
|
|
||||||
// cr4 flags
|
// cr4 flags
|
||||||
#define IA32_CR4_GLOBAL_PAGES (1UL << 7)
|
#define IA32_CR4_GLOBAL_PAGES (1UL << 7)
|
||||||
@@ -114,9 +114,10 @@ typedef struct x86_cpu_module_info {
|
|||||||
uint32 (*count_mtrrs)(void);
|
uint32 (*count_mtrrs)(void);
|
||||||
void (*init_mtrrs)(void);
|
void (*init_mtrrs)(void);
|
||||||
|
|
||||||
void (*set_mtrr)(uint32 index, uint64 base, uint64 length, uint8 type);
|
void (*set_mtrr)(uint32 index, uint64 base, uint64 length,
|
||||||
status_t (*get_mtrr)(uint32 index, uint64 *_base, uint64 *_length,
|
uint8 type);
|
||||||
uint8 *_type);
|
status_t (*get_mtrr)(uint32 index, uint64* _base, uint64* _length,
|
||||||
|
uint8* _type);
|
||||||
|
|
||||||
void (*get_optimized_functions)(x86_optimized_functions* functions);
|
void (*get_optimized_functions)(x86_optimized_functions* functions);
|
||||||
} x86_cpu_module_info;
|
} x86_cpu_module_info;
|
||||||
@@ -198,9 +199,9 @@ struct vm86_iframe {
|
|||||||
uint16 gs, __gsh;
|
uint16 gs, __gsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IFRAME_IS_USER(f) ( ((f)->cs == USER_CODE_SEG) \
|
#define IFRAME_IS_USER(f) ((f)->cs == USER_CODE_SEG \
|
||||||
|| (((f)->flags & 0x20000) != 0 ))
|
|| ((f)->flags & 0x20000) != 0)
|
||||||
#define IFRAME_IS_VM86(f) ( ((f)->flags & 0x20000) != 0 )
|
#define IFRAME_IS_VM86(f) (((f)->flags & 0x20000) != 0)
|
||||||
|
|
||||||
// features
|
// features
|
||||||
enum x86_feature_type {
|
enum x86_feature_type {
|
||||||
@@ -231,7 +232,7 @@ typedef struct arch_cpu_info {
|
|||||||
enum x86_vendors vendor;
|
enum x86_vendors vendor;
|
||||||
uint32 feature[FEATURE_NUM];
|
uint32 feature[FEATURE_NUM];
|
||||||
char model_name[49];
|
char model_name[49];
|
||||||
const char *vendor_name;
|
const char* vendor_name;
|
||||||
int type;
|
int type;
|
||||||
int family;
|
int family;
|
||||||
int extended_family;
|
int extended_family;
|
||||||
@@ -254,20 +255,21 @@ extern "C" {
|
|||||||
|
|
||||||
struct arch_thread;
|
struct arch_thread;
|
||||||
|
|
||||||
void __x86_setup_system_time(uint32 cv_factor);
|
void __x86_setup_system_time(uint32 conversionFactor);
|
||||||
void i386_context_switch(struct arch_thread *old_state, struct arch_thread *new_state, addr_t new_pgdir);
|
void i386_context_switch(struct arch_thread* oldState,
|
||||||
|
struct arch_thread* newState, addr_t newPageDir);
|
||||||
void x86_userspace_thread_exit(void);
|
void x86_userspace_thread_exit(void);
|
||||||
void x86_end_userspace_thread_exit(void);
|
void x86_end_userspace_thread_exit(void);
|
||||||
void x86_enter_userspace(addr_t entry, addr_t stackTop);
|
void x86_enter_userspace(addr_t entry, addr_t stackTop);
|
||||||
void i386_set_tss_and_kstack(addr_t kstack);
|
void i386_set_tss_and_kstack(addr_t kstack);
|
||||||
void i386_switch_stack_and_call(addr_t stack, void (*func)(void *), void *arg);
|
void i386_switch_stack_and_call(addr_t stack, void (*func)(void*), void* arg);
|
||||||
void i386_swap_pgdir(addr_t new_pgdir);
|
void i386_swap_pgdir(addr_t newPageDir);
|
||||||
void i386_fnsave(void *fpu_state);
|
void i386_fnsave(void* fpuState);
|
||||||
void i386_fxsave(void *fpu_state);
|
void i386_fxsave(void* fpuState);
|
||||||
void i386_frstor(const void *fpu_state);
|
void i386_frstor(const void* fpuState);
|
||||||
void i386_fxrstor(const void *fpu_state);
|
void i386_fxrstor(const void* fpuState);
|
||||||
void i386_fnsave_swap(void *old_fpu_state, const void *new_fpu_state);
|
void i386_fnsave_swap(void* oldFpuState, const void* newFpuState);
|
||||||
void i386_fxsave_swap(void *old_fpu_state, const void *new_fpu_state);
|
void i386_fxsave_swap(void* oldFpuState, const void* newFpuState);
|
||||||
uint32 x86_read_ebp();
|
uint32 x86_read_ebp();
|
||||||
uint32 x86_read_cr0();
|
uint32 x86_read_cr0();
|
||||||
void x86_write_cr0(uint32 value);
|
void x86_write_cr0(uint32 value);
|
||||||
@@ -279,7 +281,8 @@ void x86_set_task_gate(int32 cpu, int32 n, int32 segment);
|
|||||||
void* x86_get_idt(int32 cpu);
|
void* x86_get_idt(int32 cpu);
|
||||||
uint32 x86_count_mtrrs(void);
|
uint32 x86_count_mtrrs(void);
|
||||||
void x86_set_mtrr(uint32 index, uint64 base, uint64 length, uint8 type);
|
void x86_set_mtrr(uint32 index, uint64 base, uint64 length, uint8 type);
|
||||||
status_t x86_get_mtrr(uint32 index, uint64 *_base, uint64 *_length, uint8 *_type);
|
status_t x86_get_mtrr(uint32 index, uint64* _base, uint64* _length,
|
||||||
|
uint8* _type);
|
||||||
bool x86_check_feature(uint32 feature, enum x86_feature_type type);
|
bool x86_check_feature(uint32 feature, enum x86_feature_type type);
|
||||||
void* x86_get_double_fault_stack(int32 cpu, size_t* _size);
|
void* x86_get_double_fault_stack(int32 cpu, size_t* _size);
|
||||||
int32 x86_double_fault_get_cpu(void);
|
int32 x86_double_fault_get_cpu(void);
|
||||||
@@ -347,7 +350,7 @@ void x86_page_fault_exception_double_fault(struct iframe* frame);
|
|||||||
_v; \
|
_v; \
|
||||||
})
|
})
|
||||||
|
|
||||||
extern segment_descriptor *gGDT;
|
extern segment_descriptor* gGDT;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Reference in New Issue
Block a user