1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Merge amd64 and i386 bus.h and move the resulting header to x86. Replace

the original amd64 and i386 headers with stubs.

Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere.

Reviewed by:	imp (previous version), jhb
Approved by:	kib (mentor)
This commit is contained in:
Tijl Coosemans 2010-12-20 16:39:43 +00:00
parent 94877c06f3
commit 81bd5041a2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216592
13 changed files with 1125 additions and 2280 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,13 +35,8 @@
#ifndef _HAL_VAR_H_
#define _HAL_VAR_H_
#ifdef __amd64__
#define NDIS_BUS_SPACE_IO AMD64_BUS_SPACE_IO
#define NDIS_BUS_SPACE_MEM AMD64_BUS_SPACE_MEM
#else
#define NDIS_BUS_SPACE_IO I386_BUS_SPACE_IO
#define NDIS_BUS_SPACE_MEM I386_BUS_SPACE_MEM
#endif
#define NDIS_BUS_SPACE_IO X86_BUS_SPACE_IO
#define NDIS_BUS_SPACE_MEM X86_BUS_SPACE_MEM
extern image_patch_table hal_functbl[];

View File

@ -174,10 +174,8 @@ atkbdc_configure(void)
#endif
/* XXX: tag should be passed from the caller */
#if defined(__i386__)
tag = I386_BUS_SPACE_IO;
#elif defined(__amd64__)
tag = AMD64_BUS_SPACE_IO;
#if defined(__amd64__) || defined(__i386__)
tag = X86_BUS_SPACE_IO;
#elif defined(__ia64__)
tag = IA64_BUS_SPACE_IO;
#elif defined(__sparc64__)

View File

@ -6261,8 +6261,8 @@ int if_lmc_lkmentry(struct lkm_table *lkmtp, int cmd, int ver)
/* XXX Why isn't there an LKM network interface module? XXX */
pa.pa_pc = NULL; /* XXX */
pa.pa_bus = 0; /* XXX */
pa.pa_iot = I386_BUS_SPACE_IO; /* XXX */
pa.pa_memt = I386_BUS_SPACE_MEM; /* XXX */
pa.pa_iot = X86_BUS_SPACE_IO; /* XXX */
pa.pa_memt = X86_BUS_SPACE_MEM; /* XXX */
pa.pa_dmat = &pci_bus_dma_tag; /* XXX */
for (pa.pa_device=0; pa.pa_device<32; pa.pa_device++) /* XXX */
{

View File

@ -372,10 +372,8 @@ sis_read_cmos(struct sis_softc *sc, device_t dev, caddr_t dest, int off, int cnt
pci_write_config(bridge, 0x48, reg|0x40, 1);
/* XXX */
#if defined(__i386__)
btag = I386_BUS_SPACE_IO;
#elif defined(__amd64__)
btag = AMD64_BUS_SPACE_IO;
#if defined(__amd64__) || defined(__i386__)
btag = X86_BUS_SPACE_IO;
#endif
for (i = 0; i < cnt; i++) {

View File

@ -133,7 +133,7 @@ clkrun_hack(int run)
if (pci_get_vendor(*childp) == 0x8086 && pci_get_device(*childp) == 0x7113) {
port = (pci_read_config(*childp, 0x41, 1) << 8) + 0x10;
/* XXX */
btag = I386_BUS_SPACE_IO;
btag = X86_BUS_SPACE_IO;
control = bus_space_read_2(btag, 0x0, port);
control &= ~0x2000;

View File

@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
bus_space_tag_t uart_bus_space_io = AMD64_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = AMD64_BUS_SPACE_MEM;
bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM;
int
uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)

View File

@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
bus_space_tag_t uart_bus_space_io = I386_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = I386_BUS_SPACE_MEM;
bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM;
int
uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2)

View File

@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$");
#include <dev/uart/uart.h>
#include <dev/uart/uart_cpu.h>
bus_space_tag_t uart_bus_space_io = I386_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = I386_BUS_SPACE_MEM;
bus_space_tag_t uart_bus_space_io = X86_BUS_SPACE_IO;
bus_space_tag_t uart_bus_space_mem = X86_BUS_SPACE_MEM;
static struct {
u_long iobase;

File diff suppressed because it is too large Load Diff

View File

@ -192,8 +192,8 @@ struct bus_space_handle {
extern struct bus_space_tag SBUS_io_space_tag;
extern struct bus_space_tag SBUS_mem_space_tag;
#define I386_BUS_SPACE_IO (&SBUS_io_space_tag)
#define I386_BUS_SPACE_MEM (&SBUS_mem_space_tag)
#define X86_BUS_SPACE_IO (&SBUS_io_space_tag)
#define X86_BUS_SPACE_MEM (&SBUS_mem_space_tag)
/*
* Allocate/Free bus_space_handle

1098
sys/x86/include/bus.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -84,14 +84,6 @@ __FBSDID("$FreeBSD$");
#endif
#include <sys/rtprio.h>
#ifdef __amd64__
#define BUS_SPACE_IO AMD64_BUS_SPACE_IO
#define BUS_SPACE_MEM AMD64_BUS_SPACE_MEM
#else
#define BUS_SPACE_IO I386_BUS_SPACE_IO
#define BUS_SPACE_MEM I386_BUS_SPACE_MEM
#endif
#define ELF_KERN_STR ("elf"__XSTRING(__ELF_WORD_SIZE)" kernel")
static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device");
@ -425,7 +417,7 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
switch (type) {
case SYS_RES_IOPORT:
#ifdef PC98
error = i386_bus_space_handle_alloc(I386_BUS_SPACE_IO,
error = i386_bus_space_handle_alloc(X86_BUS_SPACE_IO,
rman_get_start(r), rman_get_size(r), &bh);
if (error)
return (error);
@ -433,18 +425,18 @@ nexus_activate_resource(device_t bus, device_t child, int type, int rid,
#else
rman_set_bushandle(r, rman_get_start(r));
#endif
rman_set_bustag(r, BUS_SPACE_IO);
rman_set_bustag(r, X86_BUS_SPACE_IO);
break;
case SYS_RES_MEMORY:
#ifdef PC98
error = i386_bus_space_handle_alloc(I386_BUS_SPACE_MEM,
error = i386_bus_space_handle_alloc(X86_BUS_SPACE_MEM,
rman_get_start(r), rman_get_size(r), &bh);
if (error)
return (error);
#endif
vaddr = pmap_mapdev(rman_get_start(r), rman_get_size(r));
rman_set_virtual(r, vaddr);
rman_set_bustag(r, BUS_SPACE_MEM);
rman_set_bustag(r, X86_BUS_SPACE_MEM);
#ifdef PC98
/* PC-98: the type of bus_space_handle_t is the structure. */
bh->bsh_base = (bus_addr_t) vaddr;