1 /* 2 * Copyright 2005, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 9 10 #include "amd.h" 11 12 13 static uint32 14 amd_count_mtrrs(void) 15 { 16 return 0; 17 } 18 19 20 static status_t 21 amd_set_mtrr(uint32 index, addr_t base, addr_t length, uint32 type) 22 { 23 return B_OK; 24 } 25 26 27 static status_t 28 amd_unset_mtrr(uint32 index) 29 { 30 return B_OK; 31 } 32 33 34 static status_t 35 amd_init(void) 36 { 37 system_info info; 38 if (get_system_info(&info) != B_OK) 39 return B_ERROR; 40 41 if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_AMD_x86) 42 return B_ERROR; 43 44 return B_OK; 45 } 46 47 48 static status_t 49 amd_uninit(void) 50 { 51 return B_OK; 52 } 53 54 55 static status_t 56 amd_stdops(int32 op, ...) 57 { 58 switch (op) { 59 case B_MODULE_INIT: 60 return amd_init(); 61 case B_MODULE_UNINIT: 62 return amd_uninit(); 63 } 64 65 return B_ERROR; 66 } 67 68 69 x86_cpu_module_info gAMDModule = { 70 { 71 "cpu/generic_x86/amd/v1", 72 0, 73 amd_stdops, 74 }, 75 76 amd_count_mtrrs, 77 amd_set_mtrr, 78 amd_unset_mtrr, 79 }; 80