From 132fdb30e6d40896de99b168c03fa56f056762fe Mon Sep 17 00:00:00 2001 From: thorpej Date: Sun, 21 Oct 2001 18:49:19 +0000 Subject: [PATCH] Make the various timing, etc. tables const, and add the __unused__ attribute to them, just in case something other than the pciide driver proper needs to pull in the header. --- sys/dev/pci/pciide_acard_reg.h | 5 +++-- sys/dev/pci/pciide_acer_reg.h | 11 +++++++---- sys/dev/pci/pciide_amd_reg.h | 5 +++-- sys/dev/pci/pciide_apollo_reg.h | 18 ++++++++++++------ sys/dev/pci/pciide_cmd_reg.h | 11 +++++++---- sys/dev/pci/pciide_cy693_reg.h | 14 +++++++++----- sys/dev/pci/pciide_hpt_reg.h | 14 +++++++------- sys/dev/pci/pciide_opti_reg.h | 18 +++++++++++------- sys/dev/pci/pciide_pdc202xx_reg.h | 20 +++++++++++++------- sys/dev/pci/pciide_piix_reg.h | 17 +++++++++++------ sys/dev/pci/pciide_sis_reg.h | 17 +++++++++++------ 11 files changed, 94 insertions(+), 56 deletions(-) diff --git a/sys/dev/pci/pciide_acard_reg.h b/sys/dev/pci/pciide_acard_reg.h index 601da4579c4c..c9a264327363 100644 --- a/sys/dev/pci/pciide_acard_reg.h +++ b/sys/dev/pci/pciide_acard_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_acard_reg.h,v 1.1 2001/04/21 16:36:38 tsutsui Exp $ */ +/* $NetBSD: pciide_acard_reg.h,v 1.2 2001/10/21 18:49:19 thorpej Exp $ */ /* * Copyright (c) 2001 Izumi Tsutsui. @@ -54,7 +54,8 @@ static const u_int8_t acard_rec_pio[] = {0x0, 0xa, 0x8, 0x3, 0x1}; #define ATP850_UDMA_MASK(channel) (0xf << ((channel) * 4)) #define ATP860_UDMA_MASK(channel) (0xff << ((channel) * 8)) -static const u_int8_t acard_udma_conf[] = {0x1, 0x2, 0x3, 0x4, 0x5}; +static const u_int8_t acard_udma_conf[] __attribute__((__unused__)) = + {0x1, 0x2, 0x3, 0x4, 0x5}; #define ATP8x0_CTRL 0x48 #define ATP8x0_CTRL_EN(chan) (0x00020000 << (chan)) diff --git a/sys/dev/pci/pciide_acer_reg.h b/sys/dev/pci/pciide_acer_reg.h index b85ab9a8b52e..29da10d3c2d9 100644 --- a/sys/dev/pci/pciide_acer_reg.h +++ b/sys/dev/pci/pciide_acer_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_acer_reg.h,v 1.4 2001/07/26 20:02:22 bouyer Exp $ */ +/* $NetBSD: pciide_acer_reg.h,v 1.5 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1999 Manuel Bouyer. @@ -99,8 +99,11 @@ #define ACER_IDE_CLK 0x78 /* acer UDMA3/4/5 from FreeBSD */ -static int8_t acer_udma[] = {0x4, 0x3, 0x2, 0x1, 0x0, 0x7}; -static int8_t acer_pio[] = {0x0c, 0x58, 0x44, 0x33, 0x31}; +static const int8_t acer_udma[] __attribute__((__unused__)) = + {0x4, 0x3, 0x2, 0x1, 0x0, 0x7}; +static const int8_t acer_pio[] __attribute__((__unused__)) = + {0x0c, 0x58, 0x44, 0x33, 0x31}; #ifdef unused -static int8_t acer_dma[] = {0x08, 0x33, 0x31}; +static const int8_t acer_dma[] __attribute__((__unused__)) = + {0x08, 0x33, 0x31}; #endif diff --git a/sys/dev/pci/pciide_amd_reg.h b/sys/dev/pci/pciide_amd_reg.h index cb2d33a8d8cd..733872f693cd 100644 --- a/sys/dev/pci/pciide_amd_reg.h +++ b/sys/dev/pci/pciide_amd_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_amd_reg.h,v 1.3 2001/05/06 20:06:35 fvdl Exp $ */ +/* $NetBSD: pciide_amd_reg.h,v 1.4 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 2000 David Sainty. @@ -80,4 +80,5 @@ static const int8_t amd7x6_pio_rec[] = {0x08, 0x08, 0x08, 0x02, 0x00}; #define AMD7X6_UDMA_EN_MTH(channel, drive) (0x80 << \ (((1 - (channel)) << 4) + ((1 - (drive)) << 3))) -static const int8_t amd7x6_udma_tim[] = {0x02, 0x01, 0x00, 0x04, 0x05, 0x06}; +static const int8_t amd7x6_udma_tim[] __attribute__((__unused__)) = + {0x02, 0x01, 0x00, 0x04, 0x05, 0x06}; diff --git a/sys/dev/pci/pciide_apollo_reg.h b/sys/dev/pci/pciide_apollo_reg.h index 55bb7cb1fa67..76e7d683b528 100644 --- a/sys/dev/pci/pciide_apollo_reg.h +++ b/sys/dev/pci/pciide_apollo_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_apollo_reg.h,v 1.9 2001/05/04 15:25:06 bouyer Exp $ */ +/* $NetBSD: pciide_apollo_reg.h,v 1.10 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -90,8 +90,14 @@ (((1 - (channel)) << 4) + ((1 - (drive)) << 3))) #define APO_UDMA_CLK66(channel) (0x08 << ((1 - (channel)) << 4)) -static int8_t apollo_udma100_tim[] = {0x0f, 0x07, 0x04, 0x02, 0x01, 0x00}; /* XXX check modes others than 2, 4, 5 */ -static int8_t apollo_udma66_tim[] = {0x03, 0x03, 0x02, 0x01, 0x00}; -static int8_t apollo_udma33_tim[] = {0x03, 0x02, 0x00}; -static int8_t apollo_pio_set[] = {0x0a, 0x0a, 0x0a, 0x02, 0x02}; -static int8_t apollo_pio_rec[] = {0x08, 0x08, 0x08, 0x02, 0x00}; +static const int8_t apollo_udma100_tim[] __attribute__((__unused__)) = + /* XXX Check modes other than 2, 4, 5 */ + {0x0f, 0x07, 0x04, 0x02, 0x01, 0x00}; +static const int8_t apollo_udma66_tim[] __attribute__((__unused__)) = + {0x03, 0x03, 0x02, 0x01, 0x00}; +static const int8_t apollo_udma33_tim[] __attribute__((__unused__)) = + {0x03, 0x02, 0x00}; +static const int8_t apollo_pio_set[] __attribute__((__unused__)) = + {0x0a, 0x0a, 0x0a, 0x02, 0x02}; +static const int8_t apollo_pio_rec[] __attribute__((__unused__)) = + {0x08, 0x08, 0x08, 0x02, 0x00}; diff --git a/sys/dev/pci/pciide_cmd_reg.h b/sys/dev/pci/pciide_cmd_reg.h index 3b43d5c81a17..c85dc1093716 100644 --- a/sys/dev/pci/pciide_cmd_reg.h +++ b/sys/dev/pci/pciide_cmd_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_cmd_reg.h,v 1.9 2000/08/02 20:23:46 bouyer Exp $ */ +/* $NetBSD: pciide_cmd_reg.h,v 1.10 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -97,12 +97,15 @@ #define CMD_UDMATIM_UDMA33(drive) (0x04 << (drive)) #define CMD_UDMATIM_TIM_MASK 0x3 #define CMD_UDMATIM_TIM_OFF(drive) (4 + ((drive) * 2)) -static int8_t cmd0646_9_tim_udma[] = {0x03, 0x02, 0x01, 0x02, 0x01}; +static const int8_t cmd0646_9_tim_udma[] __attribute__((__unused__)) = + {0x03, 0x02, 0x01, 0x02, 0x01}; /* * timings values for the 0643/6/8/9 * for all dma_mode we have to have * DMA_timings(dma_mode) >= PIO_timings(dma_mode + 2) */ -static int8_t cmd0643_9_data_tim_pio[] = {0xA9, 0x57, 0x44, 0x32, 0x3F}; -static int8_t cmd0643_9_data_tim_dma[] = {0x87, 0x32, 0x3F}; +static const int8_t cmd0643_9_data_tim_pio[] __attribute__((__unused__)) = + {0xA9, 0x57, 0x44, 0x32, 0x3F}; +static const int8_t cmd0643_9_data_tim_dma[] __attribute__((__unused__)) = + {0x87, 0x32, 0x3F}; diff --git a/sys/dev/pci/pciide_cy693_reg.h b/sys/dev/pci/pciide_cy693_reg.h index 19765cbe7afe..4d0523ed199c 100644 --- a/sys/dev/pci/pciide_cy693_reg.h +++ b/sys/dev/pci/pciide_cy693_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_cy693_reg.h,v 1.4 2000/05/15 08:46:01 bouyer Exp $ */ +/* $NetBSD: pciide_cy693_reg.h,v 1.5 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -63,11 +63,15 @@ #define CY_CMD_CTRL_IOR_PULSE_OFF(drive) (4 + 16 * (drive)) #define CY_CMD_CTRL_IOR_REC_OFF(drive) (0 + 16 * (drive)) -static int8_t cy_pio_pulse[] = {9, 4, 3, 2, 2}; -static int8_t cy_pio_rec[] = {9, 7, 4, 2, 0}; +static const int8_t cy_pio_pulse[] __attribute__((__unused__)) = + {9, 4, 3, 2, 2}; +static const int8_t cy_pio_rec[] __attribute__((__unused__)) = + {9, 7, 4, 2, 0}; #ifdef unused -static int8_t cy_dma_pulse[] = {7, 2, 2}; -static int8_t cy_dma_rec[] = {7, 1, 0}; +static const int8_t cy_dma_pulse[] __attribute__((__unused__)) = + {7, 2, 2}; +static const int8_t cy_dma_rec[] __attribute__((__unused__)) = + {7, 1, 0}; #endif /* diff --git a/sys/dev/pci/pciide_hpt_reg.h b/sys/dev/pci/pciide_hpt_reg.h index 1c29f17d0d6b..7c603ba16961 100644 --- a/sys/dev/pci/pciide_hpt_reg.h +++ b/sys/dev/pci/pciide_hpt_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_hpt_reg.h,v 1.4 2001/07/23 14:55:27 bouyer Exp $ */ +/* $NetBSD: pciide_hpt_reg.h,v 1.5 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 2000 Manuel Bouyer. @@ -114,17 +114,17 @@ #define HPT_CSEL_PCIWR 0x04 /* 370 only */ #define HPT_CSEL_CBLID(chan) (0x01 << (1 - (chan))) -static u_int32_t hpt366_pio[] = +static const u_int32_t hpt366_pio[] __attribute__((__unused__)) = {0x00d0a7aa, 0x00c8a753, 0x00c8a742, 0x00c8a731}; -static u_int32_t hpt366_dma[] = +static const u_int32_t hpt366_dma[] __attribute__((__unused__)) = {0x20c8a797, 0x20c8a742, 0x20c8a731}; -static u_int32_t hpt366_udma[] = +static const u_int32_t hpt366_udma[] __attribute__((__unused__)) = {0x10c8a731, 0x10cba731, 0x10caa731, 0x10cfa731, 0x10c9a731}; -static u_int32_t hpt370_pio[] = +static const u_int32_t hpt370_pio[] __attribute__((__unused__)) = {0x06914e8a, 0x06914e65, 0x06514e33, 0x06514e22, 0x06514e21}; -static u_int32_t hpt370_dma[] = +static const u_int32_t hpt370_dma[] __attribute__((__unused__)) = {0x26514e97, 0x26514e33, 0x26514e21}; -static u_int32_t hpt370_udma[] = +static const u_int32_t hpt370_udma[] __attribute__((__unused__)) = {0x16514e31, 0x164d4e31, 0x16494e31, 0x166d4e31, 0x16454e31, 0x1a85f442}; diff --git a/sys/dev/pci/pciide_opti_reg.h b/sys/dev/pci/pciide_opti_reg.h index 800ebc6a6581..3dafb4cf0be0 100644 --- a/sys/dev/pci/pciide_opti_reg.h +++ b/sys/dev/pci/pciide_opti_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_opti_reg.h,v 1.2 2000/06/07 20:42:53 scw Exp $ */ +/* $NetBSD: pciide_opti_reg.h,v 1.3 2001/10/21 18:49:20 thorpej Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -112,7 +112,7 @@ * break things in subtle ways if the wdc registers are accessed * by an interrupt routine while this magic sequence is executing. */ -static __inline__ u_int8_t +static __inline__ u_int8_t __attribute__((__unused__)) opti_read_config(struct channel_softc *chp, int reg) { u_int8_t rv; @@ -136,7 +136,7 @@ opti_read_config(struct channel_softc *chp, int reg) return rv; } -static __inline__ void +static __inline__ void __attribute__((__unused__)) opti_write_config(struct channel_softc *chp, int reg, u_int8_t val) { int s = splhigh(); @@ -162,21 +162,25 @@ opti_write_config(struct channel_softc *chp, int reg, u_int8_t val) * supported by the OPTi chip. The first index of the two-dimensional * arrays is used for a 33MHz PCIbus, the second for a 25MHz PCIbus. */ -static u_int8_t opti_tim_cp[2][8] = { /* Command Pulse */ +static const u_int8_t opti_tim_cp[2][8] __attribute__((__unused__)) = { + /* Command Pulse */ {5, 4, 3, 2, 2, 7, 2, 2}, {4, 3, 2, 2, 1, 5, 2, 1} }; -static u_int8_t opti_tim_rt[2][8] = { /* Recovery Time */ +static const u_int8_t opti_tim_rt[2][8] __attribute__((__unused__)) = { + /* Recovery Time */ {9, 4, 0, 0, 0, 6, 0, 0}, {6, 2, 0, 0, 0, 4, 0, 0} }; -static u_int8_t opti_tim_as[2][8] = { /* Address Setup */ +static const u_int8_t opti_tim_as[2][8] __attribute__((__unused__)) = { + /* Address Setup */ {2, 1, 1, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 0} }; -static u_int8_t opti_tim_em[8] = { /* Enhanced Mode */ +static const u_int8_t opti_tim_em[8] __attribute__((__unused__)) = { + /* Enhanced Mode */ 0, 0, 0, 1, 2, 0, 1 ,2 }; diff --git a/sys/dev/pci/pciide_pdc202xx_reg.h b/sys/dev/pci/pciide_pdc202xx_reg.h index 17a5f3aadc31..7346e5028839 100644 --- a/sys/dev/pci/pciide_pdc202xx_reg.h +++ b/sys/dev/pci/pciide_pdc202xx_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_pdc202xx_reg.h,v 1.5 2001/07/05 08:38:27 toshii Exp $ */ +/* $NetBSD: pciide_pdc202xx_reg.h,v 1.6 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1999 Manuel Bouyer. @@ -106,9 +106,15 @@ * rigth for the PDC20246 too ... */ -static int8_t pdc2xx_pa[] = {0x9, 0x5, 0x3, 0x2, 0x1}; -static int8_t pdc2xx_pb[] = {0x13, 0xc, 0x8, 0x6, 0x4}; -static int8_t pdc2xx_dma_mb[] = {0x3, 0x3, 0x3}; -static int8_t pdc2xx_dma_mc[] = {0x5, 0x4, 0x3}; -static int8_t pdc2xx_udma_mb[] = {0x3, 0x2, 0x1, 0x2, 0x1, 0x1}; -static int8_t pdc2xx_udma_mc[] = {0x3, 0x2, 0x1, 0x2, 0x1, 0x1}; +static const int8_t pdc2xx_pa[] __attribute__((__unused__)) = + {0x9, 0x5, 0x3, 0x2, 0x1}; +static const int8_t pdc2xx_pb[] __attribute__((__unused__)) = + {0x13, 0xc, 0x8, 0x6, 0x4}; +static const int8_t pdc2xx_dma_mb[] __attribute__((__unused__)) = + {0x3, 0x3, 0x3}; +static const int8_t pdc2xx_dma_mc[] __attribute__((__unused__)) = + {0x5, 0x4, 0x3}; +static const int8_t pdc2xx_udma_mb[] __attribute__((__unused__)) = + {0x3, 0x2, 0x1, 0x2, 0x1, 0x1}; +static const int8_t pdc2xx_udma_mc[] __attribute__((__unused__)) = + {0x3, 0x2, 0x1, 0x2, 0x1, 0x1}; diff --git a/sys/dev/pci/pciide_piix_reg.h b/sys/dev/pci/pciide_piix_reg.h index 34dfa40ff114..04270a8d63f9 100644 --- a/sys/dev/pci/pciide_piix_reg.h +++ b/sys/dev/pci/pciide_piix_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_piix_reg.h,v 1.5 2001/01/05 15:29:40 bouyer Exp $ */ +/* $NetBSD: pciide_piix_reg.h,v 1.6 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -114,8 +114,13 @@ * ISP and RTC registers for the various PIO and DMA mode * (from the PIIX4 doc). */ -static int8_t piix_isp_pio[] = {0x00, 0x00, 0x01, 0x02, 0x02}; -static int8_t piix_rtc_pio[] = {0x00, 0x00, 0x00, 0x01, 0x03}; -static int8_t piix_isp_dma[] = {0x00, 0x02, 0x02}; -static int8_t piix_rtc_dma[] = {0x00, 0x02, 0x03}; -static int8_t piix4_sct_udma[] = {0x00, 0x01, 0x02, 0x01, 0x02, 0x01}; +static const int8_t piix_isp_pio[] __attribute__((__unused__)) = + {0x00, 0x00, 0x01, 0x02, 0x02}; +static const int8_t piix_rtc_pio[] __attribute__((__unused__)) = + {0x00, 0x00, 0x00, 0x01, 0x03}; +static const int8_t piix_isp_dma[] __attribute__((__unused__)) = + {0x00, 0x02, 0x02}; +static const int8_t piix_rtc_dma[] __attribute__((__unused__)) = + {0x00, 0x02, 0x03}; +static const int8_t piix4_sct_udma[] __attribute__((__unused__)) = + {0x00, 0x01, 0x02, 0x01, 0x02, 0x01}; diff --git a/sys/dev/pci/pciide_sis_reg.h b/sys/dev/pci/pciide_sis_reg.h index 54e8354fe417..672fd0a80d2c 100644 --- a/sys/dev/pci/pciide_sis_reg.h +++ b/sys/dev/pci/pciide_sis_reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: pciide_sis_reg.h,v 1.7 2001/10/16 08:10:24 tron Exp $ */ +/* $NetBSD: pciide_sis_reg.h,v 1.8 2001/10/21 18:49:20 thorpej Exp $ */ /* * Copyright (c) 1998 Manuel Bouyer. @@ -63,10 +63,15 @@ #define SIS_MISC_GTC 0x04 #define SIS_MISC_FIFO_SIZE 0x01 -static int8_t sis_pio_act[] = {7, 5, 4, 3, 3}; -static int8_t sis_pio_rec[] = {7, 0, 5, 3, 1}; +static const int8_t sis_pio_act[] __attribute__((__unused__)) = + {7, 5, 4, 3, 3}; +static const int8_t sis_pio_rec[] __attribute__((__unused__)) = + {7, 0, 5, 3, 1}; #ifdef unused -static int8_t sis_dma_act[] = {0, 3, 3}; -static int8_t sis_dma_rec[] = {0, 2, 1}; +static const int8_t sis_dma_act[] __attribute__((__unused__)) = + {0, 3, 3}; +static const int8_t sis_dma_rec[] __attribute__((__unused__)) = + {0, 2, 1}; #endif -static int8_t sis_udma_tim[] = {14, 12, 10, 10, 9, 8}; +static const int8_t sis_udma_tim[] __attribute__((__unused__)) = + {14, 12, 10, 10, 9, 8};