Some work in progress of the MTRR support. Shouldn't do any harm yet :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15525 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -24,7 +24,7 @@ void arch_vm_aspace_swap(vm_address_space *aspace);
|
||||
bool arch_vm_supports_protection(uint32 protection);
|
||||
void arch_vm_init_area(vm_area *area);
|
||||
|
||||
status_t arch_vm_set_memory_type(vm_area *area, uint32 type);
|
||||
status_t arch_vm_set_memory_type(vm_area *area, addr_t physicalBase, uint32 type);
|
||||
void arch_vm_unset_memory_type(vm_area *area);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -14,14 +14,23 @@
|
||||
|
||||
|
||||
// MSR registers (possibly Intel specific)
|
||||
#define IA32_MSR_APIC_BASE 0x1b
|
||||
#define IA32_MSR_APIC_BASE 0x1b
|
||||
|
||||
#define IA32_MSR_MTRR_CAPABILITIES 0xfe
|
||||
#define IA32_MSR_MTRR_DEFAULT_TYPE 0x2ff
|
||||
#define IA32_MSR_MTRR_PHYSICAL_BASE_0 0x200
|
||||
#define IA32_MSR_MTRR_PHYSICAL_MASK_0 0x201
|
||||
|
||||
|
||||
typedef struct x86_cpu_module_info {
|
||||
module_info info;
|
||||
uint32 (*count_mtrrs)(void);
|
||||
status_t (*set_mtrr)(uint32 index, addr_t base, addr_t length, uint32 type);
|
||||
status_t (*unset_mtrr)(uint32 index);
|
||||
status_t (*enable_mtrrs)(void);
|
||||
void (*disable_mtrrs)(void);
|
||||
|
||||
void (*set_mtrr)(uint32 index, addr_t base, addr_t length, uint32 type);
|
||||
status_t (*get_mtrr)(uint32 index, addr_t *_base, addr_t *_length,
|
||||
uint32 *_type);
|
||||
} x86_cpu_module_info;
|
||||
|
||||
|
||||
@@ -91,8 +100,10 @@ uint64 x86_read_msr(uint32 registerNumber);
|
||||
void x86_write_msr(uint32 registerNumber, uint64 value);
|
||||
void x86_set_task_gate(int32 n, int32 segment);
|
||||
uint32 x86_count_mtrrs(void);
|
||||
status_t x86_enable_mtrrs(void);
|
||||
status_t x86_disable_mtrrs(void);
|
||||
status_t x86_set_mtrr(uint32 index, addr_t base, addr_t length, uint32 type);
|
||||
status_t x86_unset_mtrr(uint32 index);
|
||||
status_t x86_get_mtrr(uint32 index, addr_t *_base, addr_t *_length, uint32 *_type);
|
||||
struct tss *x86_get_main_tss(void);
|
||||
|
||||
#define read_ebp(value) \
|
||||
|
||||
@@ -30,6 +30,7 @@ extern "C" {
|
||||
|
||||
extern status_t debug_init(struct kernel_args *args);
|
||||
extern status_t debug_init_post_vm(struct kernel_args *args);
|
||||
extern status_t debug_init_post_modules(struct kernel_args *args);
|
||||
extern void debug_early_boot_message(const char *string);
|
||||
extern void debug_puts(const char *s);
|
||||
extern bool debug_debugger_running(void);
|
||||
|
||||
@@ -28,6 +28,7 @@ extern "C" {
|
||||
|
||||
bool frame_buffer_console_available(void);
|
||||
status_t frame_buffer_console_init(struct kernel_args *args);
|
||||
status_t frame_buffer_console_init_post_modules(struct kernel_args *args);
|
||||
|
||||
status_t _user_frame_buffer_update(addr_t baseAddress, int32 width, int32 height,
|
||||
int32 depth, int32 bytesPerRow);
|
||||
|
||||
@@ -67,6 +67,8 @@ area_id vm_clone_area(aspace_id aid, const char *name, void **address,
|
||||
status_t vm_delete_area(aspace_id aid, area_id id);
|
||||
status_t vm_create_vnode_cache(void *vnode, vm_cache_ref **_cacheRef);
|
||||
|
||||
status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type);
|
||||
|
||||
status_t vm_get_page_mapping(aspace_id aid, addr_t vaddr, addr_t *paddr);
|
||||
status_t vm_get_physical_page(addr_t paddr, addr_t *vaddr, int flags);
|
||||
status_t vm_put_physical_page(addr_t vaddr);
|
||||
|
||||
Reference in New Issue
Block a user