Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/bktr unifdef -U__bsdi__ -U__FreeBSD__ -D__NetBSD...
details: https://anonhg.NetBSD.org/src/rev/a58ee507e807
branches: trunk
changeset: 761383:a58ee507e807
user: dyoung <dyoung%NetBSD.org@localhost>
date: Wed Jan 26 00:54:35 2011 +0000
description:
unifdef -U__bsdi__ -U__FreeBSD__ -D__NetBSD__. No functional change
intended.
diffstat:
sys/dev/pci/bktr/bktr_reg.h | 163 +------------------------------------------
1 files changed, 5 insertions(+), 158 deletions(-)
diffs (241 lines):
diff -r 8199f1bbe1e1 -r a58ee507e807 sys/dev/pci/bktr/bktr_reg.h
--- a/sys/dev/pci/bktr/bktr_reg.h Wed Jan 26 00:49:56 2011 +0000
+++ b/sys/dev/pci/bktr/bktr_reg.h Wed Jan 26 00:54:35 2011 +0000
@@ -1,6 +1,6 @@
/* $SourceForge: bktr_reg.h,v 1.3 2003/03/11 23:11:27 thomasklausner Exp $ */
-/* $NetBSD: bktr_reg.h,v 1.20 2009/05/06 10:34:33 cegger Exp $ */
+/* $NetBSD: bktr_reg.h,v 1.21 2011/01/26 00:54:35 dyoung Exp $ */
/*
* $FreeBSD: src/sys/dev/bktr/bktr_reg.h,v 1.42 2000/10/31 13:09:56 roger Exp$
*
@@ -37,55 +37,17 @@
*
*/
-#ifdef __FreeBSD__
-# if (__FreeBSD_version >= 310000)
-# include "smbus.h"
-# else
-# define NSMBUS 0 /* FreeBSD before 3.1 does not have SMBUS */
-# endif
-# if (NSMBUS > 0)
-# define BKTR_USE_FREEBSD_SMBUS
-# endif
-#endif
-#ifdef __NetBSD__
#include <sys/bus.h>
#include <sys/device.h> /* device_t */
#include <sys/select.h> /* struct selinfo */
#include <sys/reboot.h> /* AB_* for bootverbose */
-#endif
/*
* The kernel options for the driver now all begin with BKTR.
* Support the older kernel options on FreeBSD and OpenBSD.
*
*/
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
-#if defined(BROOKTREE_ALLOC_PAGES)
-#define BKTR_ALLOC_PAGES BROOKTREE_ALLOC_PAGES
-#endif
-
-#if defined(BROOKTREE_SYSTEM_DEFAULT)
-#define BKTR_SYSTEM_DEFAULT BROOKTREE_SYSTEM_DEFAULT
-#endif
-
-#if defined(OVERRIDE_CARD)
-#define BKTR_OVERRIDE_CARD OVERRIDE_CARD
-#endif
-
-#if defined(OVERRIDE_TUNER)
-#define BKTR_OVERRIDE_TUNER OVERRIDE_TUNER
-#endif
-
-#if defined(OVERRIDE_DBX)
-#define BKTR_OVERRIDE_DBX OVERRIDE_DBX
-#endif
-
-#if defined(OVERRIDE_MSP)
-#define BKTR_OVERRIDE_MSP OVERRIDE_MSP
-#endif
-
-#endif
#ifndef PCI_LATENCY_TIMER
@@ -95,25 +57,6 @@
/*
* Definitions for the Brooktree 848/878 video capture to pci interface.
*/
-#ifndef __NetBSD__
-#define PCI_VENDOR_SHIFT 0
-#define PCI_VENDOR_MASK 0xffff
-#define PCI_VENDOR(id) \
- (((id) >> PCI_VENDOR_SHIFT) & PCI_VENDOR_MASK)
-
-#define PCI_PRODUCT_SHIFT 16
-#define PCI_PRODUCT_MASK 0xffff
-#define PCI_PRODUCT(id) \
- (((id) >> PCI_PRODUCT_SHIFT) & PCI_PRODUCT_MASK)
-
-/* PCI vendor ID */
-#define PCI_VENDOR_BROOKTREE 0x109e /* Brooktree */
-/* Brooktree products */
-#define PCI_PRODUCT_BROOKTREE_BT848 0x0350 /* Bt848 Video Capture */
-#define PCI_PRODUCT_BROOKTREE_BT849 0x0351 /* Bt849 Video Capture */
-#define PCI_PRODUCT_BROOKTREE_BT878 0x036e /* Bt878 Video Capture */
-#define PCI_PRODUCT_BROOKTREE_BT879 0x036f /* Bt879 Video Capture */
-#endif
#define BROOKTREE_848 1
#define BROOKTREE_848A 2
@@ -469,10 +412,6 @@
* memory mapped structure method only works on 32 bit processors
* with the right type of endianness.
*/
-#if defined(__NetBSD__) || (defined(__FreeBSD__) && (__FreeBSD_version >=300000))
-
-#if defined(__NetBSD__)
-
struct bktr_softc;
u_int8_t bktr_INB(struct bktr_softc *, int);
@@ -489,27 +428,6 @@
#define OUTW(bktr,offset,value) bktr_OUTW(bktr,offset,value)
#define OUTL(bktr,offset,value) bktr_OUTL(bktr,offset,value)
-#else
-
-#define INB(bktr,offset) bus_space_read_1((bktr)->memt,(bktr)->memh,(offset))
-#define INW(bktr,offset) bus_space_read_2((bktr)->memt,(bktr)->memh,(offset))
-#define INL(bktr,offset) bus_space_read_4((bktr)->memt,(bktr)->memh,(offset))
-#define OUTB(bktr,offset,value) bus_space_write_1((bktr)->memt,(bktr)->memh,(offset),(value))
-#define OUTW(bktr,offset,value) bus_space_write_2((bktr)->memt,(bktr)->memh,(offset),(value))
-#define OUTL(bktr,offset,value) bus_space_write_4((bktr)->memt,(bktr)->memh,(offset),(value))
-
-#endif /* __NetBSD__ */
-
-#else
-#define INB(bktr,offset) *(volatile unsigned char*) ((int)((bktr)->memh)+(offset))
-#define INW(bktr,offset) *(volatile unsigned short*)((int)((bktr)->memh)+(offset))
-#define INL(bktr,offset) *(volatile unsigned int*) ((int)((bktr)->memh)+(offset))
-#define OUTB(bktr,offset,value) *(volatile unsigned char*) ((int)((bktr)->memh)+(offset)) = (value)
-#define OUTW(bktr,offset,value) *(volatile unsigned short*)((int)((bktr)->memh)+(offset)) = (value)
-#define OUTL(bktr,offset,value) *(volatile unsigned int*) ((int)((bktr)->memh)+(offset)) = (value)
-#endif
-
-
typedef struct bktr_clip bktr_clip_t;
/*
@@ -517,14 +435,7 @@
*/
struct bktr_softc {
-#if defined (__bsdi__)
- struct device bktr_dev; /* base device */
- struct isadev bktr_id; /* ISA device */
- struct intrhand bktr_ih; /* interrupt vectoring */
- #define pcici_t pci_devaddr_t
-#endif
-#if defined(__NetBSD__)
struct device bktr_dev; /* base device */
bus_dma_tag_t dmat; /* DMA tag */
bus_space_tag_t memt;
@@ -536,70 +447,16 @@
bus_dmamap_t dm_mem;
bus_dmamap_t dm_vbidata;
bus_dmamap_t dm_vbibuffer;
-#endif
-
-#if defined(__OpenBSD__)
- struct device bktr_dev; /* base device */
- bus_dma_tag_t dmat; /* DMA tag */
- bus_space_tag_t memt;
- bus_space_handle_t memh;
- bus_size_t obmemsz; /* size of en card (bytes) */
- void *ih;
- bus_dmamap_t dm_prog;
- bus_dmamap_t dm_oprog;
- bus_dmamap_t dm_mem;
- bus_dmamap_t dm_vbidata;
- bus_dmamap_t dm_vbibuffer;
- size_t dm_mapsize;
- pci_chipset_tag_t pc; /* Opaque PCI chipset tag */
- pcitag_t tag; /* PCI tag, for doing PCI commands */
- vm_offset_t phys_base; /* Bt848 register physical address */
-#endif
-#if defined (__FreeBSD__)
- #if (__FreeBSD_version < 400000)
- vm_offset_t phys_base; /* 2.x Bt848 register physical address */
- pcici_t tag; /* 2.x PCI tag, for doing PCI commands */
- #endif
- #if (__FreeBSD_version >= 400000)
- int mem_rid; /* 4.x resource id */
- struct resource *res_mem; /* 4.x resource descriptor for registers */
- int irq_rid; /* 4.x resource id */
- struct resource *res_irq; /* 4.x resource descriptor for interrupt */
- void *res_ih; /* 4.x newbus interrupt handler cookie */
- dev_t bktrdev; /* 4.x device entry for /dev/bktrN */
- dev_t tunerdev; /* 4.x device entry for /dev/tunerN */
- dev_t vbidev; /* 4.x device entry for /dev/vbiN */
- dev_t bktrdev_alias; /* alias /dev/bktr to /dev/bktr0 */
- dev_t tunerdev_alias; /* alias /dev/tuner to /dev/tuner0 */
- dev_t vbidev_alias; /* alias /dev/vbi to /dev/vbi0 */
- #endif
- #if (__FreeBSD_version >= 310000)
- bus_space_tag_t memt; /* Bus space register access functions */
- bus_space_handle_t memh; /* Bus space register access functions */
- bus_size_t obmemsz;/* Size of card (bytes) */
- #endif
- #if (NSMBUS > 0)
- struct bktr_i2c_softc i2c_sc; /* bt848_i2c device */
- #endif
- char bktr_xname[7]; /* device name and unit number */
-#endif
+
/* The following definitions are for the contiguous memory */
-#ifdef __NetBSD__
vaddr_t bigbuf; /* buffer that holds the captured image */
vaddr_t vbidata; /* RISC program puts VBI data from the current frame here */
vaddr_t vbibuffer; /* Circular buffer holding VBI data for the user */
vaddr_t dma_prog; /* RISC prog for single and/or even field capture*/
vaddr_t odd_dma_prog; /* RISC program for Odd field capture */
-#else
- vm_offset_t bigbuf; /* buffer that holds the captured image */
- vm_offset_t vbidata; /* RISC program puts VBI data from the current frame here */
- vm_offset_t vbibuffer; /* Circular buffer holding VBI data for the user */
- vm_offset_t dma_prog; /* RISC prog for single and/or even field capture*/
- vm_offset_t odd_dma_prog;/* RISC program for Odd field capture */
-#endif
/* the following definitions are common over all platforms */
@@ -745,18 +602,8 @@
/* ioctl_cmd_t int on old versions, u_long on new versions */
/***********************************************************/
-#if (__FreeBSD__ == 2)
-typedef int ioctl_cmd_t;
-#endif
-
-#if defined(__FreeBSD__)
-#if (__FreeBSD_version >= 300000)
-typedef u_long ioctl_cmd_t;
-#endif
-#endif
-
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-typedef u_long ioctl_cmd_t;
-#endif
+typedef u_long ioctl_cmd_t;
+
+
Home |
Main Index |
Thread Index |
Old Index