Added generic x86 CPU module.
Contains (emtpy) modules for Intel/AMD/VIA models. Might be separated later, though, depending on how large they will get. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15522 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -75,6 +75,10 @@ AddFilesToHaikuImage beos system add-ons kernel generic
|
|||||||
: block_io fast_log ide_adapter locked_pool scsi_periph ;
|
: block_io fast_log ide_adapter locked_pool scsi_periph ;
|
||||||
AddFilesToHaikuImage beos system add-ons kernel partitioning_systems : intel ;
|
AddFilesToHaikuImage beos system add-ons kernel partitioning_systems : intel ;
|
||||||
|
|
||||||
|
if $(TARGET_ARCH) = x86 {
|
||||||
|
AddFilesToHaikuImage beos system add-ons kernel cpu : generic_x86 ;
|
||||||
|
}
|
||||||
|
|
||||||
# drivers
|
# drivers
|
||||||
AddDriversToHaikuImage : console dprintf keyboard null random
|
AddDriversToHaikuImage : console dprintf keyboard null random
|
||||||
<driver>tty zero ;
|
<driver>tty zero ;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel ;
|
|||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel busses ;
|
SubInclude HAIKU_TOP src add-ons kernel busses ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel console ;
|
SubInclude HAIKU_TOP src add-ons kernel console ;
|
||||||
|
SubInclude HAIKU_TOP src add-ons kernel cpu ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel disk_scanner ;
|
SubInclude HAIKU_TOP src add-ons kernel disk_scanner ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel drivers ;
|
SubInclude HAIKU_TOP src add-ons kernel drivers ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel file_cache ;
|
SubInclude HAIKU_TOP src add-ons kernel file_cache ;
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
SubDir HAIKU_TOP src add-ons kernel cpu ;
|
||||||
|
|
||||||
|
SubInclude HAIKU_TOP src add-ons kernel cpu $(TARGET_ARCH) ;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
SubDir HAIKU_TOP src add-ons kernel cpu ppc ;
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
SubDir HAIKU_TOP src add-ons kernel cpu x86 ;
|
||||||
|
|
||||||
|
UsePrivateHeaders kernel ;
|
||||||
|
|
||||||
|
KernelAddon generic_x86 : kernel cpu :
|
||||||
|
generic_x86.cpp
|
||||||
|
intel.cpp
|
||||||
|
amd.cpp
|
||||||
|
via.cpp
|
||||||
|
;
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "amd.h"
|
||||||
|
|
||||||
|
|
||||||
|
static uint32
|
||||||
|
amd_count_mtrrs(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
amd_set_mtrr(uint32 index, addr_t base, addr_t length, uint32 type)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
amd_unset_mtrr(uint32 index)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
amd_init(void)
|
||||||
|
{
|
||||||
|
system_info info;
|
||||||
|
if (get_system_info(&info) != B_OK)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_AMD_x86)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
amd_uninit(void)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
amd_stdops(int32 op, ...)
|
||||||
|
{
|
||||||
|
switch (op) {
|
||||||
|
case B_MODULE_INIT:
|
||||||
|
return amd_init();
|
||||||
|
case B_MODULE_UNINIT:
|
||||||
|
return amd_uninit();
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
x86_cpu_module_info gAMDModule = {
|
||||||
|
{
|
||||||
|
"cpu/generic_x86/amd/v1",
|
||||||
|
0,
|
||||||
|
amd_stdops,
|
||||||
|
},
|
||||||
|
|
||||||
|
amd_count_mtrrs,
|
||||||
|
amd_set_mtrr,
|
||||||
|
amd_unset_mtrr,
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef CPU_AMD_H
|
||||||
|
#define CPU_AMD_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <arch_cpu.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern x86_cpu_module_info gAMDModule;
|
||||||
|
|
||||||
|
#endif // CPU_AMD_H
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "intel.h"
|
||||||
|
#include "amd.h"
|
||||||
|
#include "via.h"
|
||||||
|
|
||||||
|
|
||||||
|
module_info *gModules[] = {
|
||||||
|
(module_info *)&gIntelModule,
|
||||||
|
(module_info *)&gAMDModule,
|
||||||
|
(module_info *)&gVIAModule,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "intel.h"
|
||||||
|
|
||||||
|
|
||||||
|
static uint32
|
||||||
|
intel_count_mtrrs(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
intel_set_mtrr(uint32 index, addr_t base, addr_t length, uint32 type)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
intel_unset_mtrr(uint32 index)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
intel_init(void)
|
||||||
|
{
|
||||||
|
system_info info;
|
||||||
|
if (get_system_info(&info) != B_OK)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_INTEL_x86)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
intel_uninit(void)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
intel_stdops(int32 op, ...)
|
||||||
|
{
|
||||||
|
switch (op) {
|
||||||
|
case B_MODULE_INIT:
|
||||||
|
return intel_init();
|
||||||
|
case B_MODULE_UNINIT:
|
||||||
|
return intel_uninit();
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
x86_cpu_module_info gIntelModule = {
|
||||||
|
{
|
||||||
|
"cpu/generic_x86/intel/v1",
|
||||||
|
0,
|
||||||
|
intel_stdops,
|
||||||
|
},
|
||||||
|
|
||||||
|
intel_count_mtrrs,
|
||||||
|
intel_set_mtrr,
|
||||||
|
intel_unset_mtrr,
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef CPU_INTEL_H
|
||||||
|
#define CPU_INTEL_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <arch_cpu.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern x86_cpu_module_info gIntelModule;
|
||||||
|
|
||||||
|
#endif // CPU_INTEL_H
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Axel Dörfler, [email protected]
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "via.h"
|
||||||
|
|
||||||
|
|
||||||
|
static uint32
|
||||||
|
via_count_mtrrs(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
via_set_mtrr(uint32 index, addr_t base, addr_t length, uint32 type)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
via_unset_mtrr(uint32 index)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
via_init(void)
|
||||||
|
{
|
||||||
|
system_info info;
|
||||||
|
if (get_system_info(&info) != B_OK)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
if ((info.cpu_type & B_CPU_x86_VENDOR_MASK) != B_CPU_VIA_IDT_x86)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
via_uninit(void)
|
||||||
|
{
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static status_t
|
||||||
|
via_stdops(int32 op, ...)
|
||||||
|
{
|
||||||
|
switch (op) {
|
||||||
|
case B_MODULE_INIT:
|
||||||
|
return via_init();
|
||||||
|
case B_MODULE_UNINIT:
|
||||||
|
return via_uninit();
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
x86_cpu_module_info gVIAModule = {
|
||||||
|
{
|
||||||
|
"cpu/generic_x86/via/v1",
|
||||||
|
0,
|
||||||
|
via_stdops,
|
||||||
|
},
|
||||||
|
|
||||||
|
via_count_mtrrs,
|
||||||
|
via_set_mtrr,
|
||||||
|
via_unset_mtrr,
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef CPU_VIA_H
|
||||||
|
#define CPU_VIA_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <arch_cpu.h>
|
||||||
|
|
||||||
|
|
||||||
|
extern x86_cpu_module_info gVIAModule;
|
||||||
|
|
||||||
|
#endif // CPU_VIA_H
|
||||||
Reference in New Issue
Block a user