* Re: PATCH powerpc: Revised merge asm-ppc*/hardirq.h
From: Jon Loeliger @ 2005-09-16 15:45 UTC (permalink / raw)
To: linuxppc64-dev, linuxppc-dev@ozlabs.org
In-Reply-To: <1126705294.14036.4.camel@cashmere.sps.mot.com>
This is a revised patch to merge asm-ppc*/hardirq.h.
It removes some unnecessary #includes, but then requires
the addition of #include <asm/irq.h> in PPC32's hw_irq.h
much like ppc64 already does. Furthermore, several
unnecessary #includes were removed from some ppc32 boards
in order to break resulting bad #include cycles.
Builds pSeries_defconfig and all ppc32 platforms except
the already b0rken bseip.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---
arch/ppc/platforms/83xx/mpc834x_sys.h | 1 -
arch/ppc/platforms/85xx/mpc85xx_ads_common.h | 1 -
arch/ppc/platforms/85xx/stx_gp3.h | 1 -
include/asm-powerpc/hardirq.h | 24 ++++++++++++++++++++
include/asm-ppc/hardirq.h | 31 --------------------------
include/asm-ppc/hw_irq.h | 1 +
include/asm-ppc64/hardirq.h | 27 -----------------------
7 files changed, 25 insertions(+), 61 deletions(-)
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -19,7 +19,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#include <linux/seq_file.h>
#include <syslib/ppc83xx_setup.h>
#include <asm/ppcboot.h>
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
@@ -19,7 +19,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#include <linux/seq_file.h>
#include <asm/ppcboot.h>
#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -21,7 +21,6 @@
#include <linux/config.h>
#include <linux/init.h>
-#include <linux/seq_file.h>
#include <asm/ppcboot.h>
#define BOARD_CCSRBAR ((uint)0xe0000000)
diff --git a/include/asm-powerpc/hardirq.h b/include/asm-powerpc/hardirq.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/hardirq.h
@@ -0,0 +1,24 @@
+#ifndef _ASM_POWERPC_HARDIRQ_H
+#define _ASM_POWERPC_HARDIRQ_H
+
+/* The __last_jiffy_stamp field is needed to ensure that no decrementer
+ * interrupt is lost on SMP machines. Since on most CPUs it is in the same
+ * cache line as local_irq_count, it is cheap to access and is also used on UP
+ * for uniformity.
+ */
+typedef struct {
+ unsigned int __softirq_pending; /* set_bit is used on this */
+ unsigned int __last_jiffy_stamp;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
+
+#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
+
+static inline void ack_bad_irq(int irq)
+{
+ printk(KERN_CRIT "illegal vector %d received!\n", irq);
+ BUG();
+}
+
+#endif /* _ASM_POWERPC_HARDIRQ_H */
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
deleted file mode 100644
--- a/include/asm-ppc/hardirq.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef __KERNEL__
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-#include <linux/config.h>
-#include <linux/cache.h>
-#include <linux/smp_lock.h>
-#include <asm/irq.h>
-
-/* The __last_jiffy_stamp field is needed to ensure that no decrementer
- * interrupt is lost on SMP machines. Since on most CPUs it is in the same
- * cache line as local_irq_count, it is cheap to access and is also used on UP
- * for uniformity.
- */
-typedef struct {
- unsigned long __softirq_pending; /* set_bit is used on this */
- unsigned int __last_jiffy_stamp;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
-
-#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
-
-static inline void ack_bad_irq(int irq)
-{
- printk(KERN_CRIT "illegal vector %d received!\n", irq);
- BUG();
-}
-
-#endif /* __ASM_HARDIRQ_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h
--- a/include/asm-ppc/hw_irq.h
+++ b/include/asm-ppc/hw_irq.h
@@ -7,6 +7,7 @@
#include <asm/ptrace.h>
#include <asm/reg.h>
+#include <asm/irq.h>
extern void timer_interrupt(struct pt_regs *);
diff --git a/include/asm-ppc64/hardirq.h b/include/asm-ppc64/hardirq.h
deleted file mode 100644
--- a/include/asm-ppc64/hardirq.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/config.h>
-#include <linux/cache.h>
-#include <linux/preempt.h>
-
-typedef struct {
- unsigned int __softirq_pending;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
-
-static inline void ack_bad_irq(int irq)
-{
- printk(KERN_CRIT "illegal vector %d received!\n", irq);
- BUG();
-}
-
-#endif /* __ASM_HARDIRQ_H */
^ permalink raw reply
* Re: I2S MPC5200
From: Bob Peterson @ 2005-09-16 16:16 UTC (permalink / raw)
To: Arnaud Carer, linuxppc-embedded
In-Reply-To: <20050916132952.9844B24001B4@mwinf0904.wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]
Hi Arnaud (and all),
My I2S audio driver seems to work fine for our icecube-based mpc5200.
It is attached for all the world to smear. Hardware assumptions are
included in
the comments. It assumes a pcm1717 i2s dac running on psc2.
It implements much of the oss and mixer ioctls, volume controls, etc.
It seems to be pretty stable:
I've fixed many interrupt and timing problems of the original and
played many songs for many days with this version of the driver.
Regards,
Bob Peterson
bob@acdstar.com
At 08:29 AM 9/16/2005, Arnaud Carer wrote:
>Hi,
>I am looking for an I2s Linux driver to implement an audio output
>with the mpc5200
>
>I2s.c and i2s_ring.c include in the DENX ELDK kernel seems to be wrong.
>
> >i2s.c is not really a driver, but a (very OLD) test version of one
> >used to demonstrate certain BestComm related problems. Don't try
> >using it as a real driver ;-)
> >The ring driver appears to be RX only,
>Thanks,
>Arnaud
>___________________________________
>
>Arnaud Carer
>Firmware Development
>
>CLEODE
><http://www.cleode.fr>www.cleode.fr
>Tel: 02 96 48 68 18
>Fax: 02 96 48 19 11
[-- Attachment #2: i2s.c --]
[-- Type: text/plain, Size: 36555 bytes --]
/* Converted from original i2s.c to work with PCM1717 dac by Bob Peterson, */
/* Advanced Communication Design, bob@acdstar.com 4/7/2005 */
/* Assumptions made for our hardware:
Assumes PSC2 is attached to your i2s audio dac
The control lines are on GPIO pins, mapped as follows:
GPIO "Timer 0" = Das Blinken Light
GPIO "Timer 1" = IDE Power
GPIO "Timer 2" = RSTB on PCM1717
GPIO "Timer 3" = MC on PCM1717
GPIO "Timer 4" = ML on PCM1717
GPIO "Timer 5" = MD on PCM1717
GPIO "Timer 6" = Backlight enable
GPIO "Timer 7" = Beeper
Other assumptions:
This assumes your primary audio device is /dev/I2S
Some programs, such as mplayer, assume the audio device is /dev/dsp or dspw
I just made a symlink, but you can change how the device is registered too.
Changes from the original i2s driver included in eldk:
1. Receive functions and interrupts are disabled (transmit only)
2. Added ioctls for oss sound device
3. Added ioctls for mixer device
4. Added extra ioctl to sound a beeper for a given length of time
5. Changed how buffering and interrupts are handled.
6. Added I2S control functions (such as volume control) separate from DAC.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/miscdevice.h>
#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/poll.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/delay.h>
#include <linux/init.h>
#include <asm/mpc5xxx.h>
#include <bestcomm_api.h>
#include <mgt5200/mgt5200.h>
#include <mgt5200/sdma.h>
#include <asm/mpc5xxx_i2s.h>
#include <linux/sound.h>
#include <linux/soundcard.h>
#include </ppc/eldk/ppc_6xx/usr/src/linux/drivers/sound/sound_config.h>
#define I2S_MINOR 242
#define BEEP_DURATION 5
#define MAX_DMA_BUFFERS 16
/* #define ENABLE_RX */
#define RX_TASK_START
#define TX_TASK_START
/* #define RDEBUG */
/* #define WDEBUG */
/* #define LITEDEBUG */
#define DEBUG_LOST_INT
#ifdef RDEBUG
#define RDPRINTK(fmt, args...) printk(fmt, ## args)
#else
#define RDPRINTK(fmt, args...)
#endif
#ifdef WDEBUG
#define WDPRINTK(fmt, args...) printk(fmt, ## args)
#else
#define WDPRINTK(fmt, args...)
#endif
/* Some bit assignments for SICR */
#define DELAY_TIME_SLOT 0x20000000
#define GEN_CLK_INT 0x00800000
#define MULTIWD_ENABLE 0x00400000
#define CLK_POL_RISING 0x00200000
#define LSB_FIRST 0x10000000
#define I2S_WAIT 3 /* 3 microsecond delay between I2S ops */
#define reg1717_vol_l 0
#define reg1717_vol_r 1
#define reg1717_vol_ldl 0x0100
#define reg1717_mute 2
#define reg1717_io_fmt 3
#define reg1717_io_iis 0x0001 /* low=normal, high=iis data fmt */
#define reg1717_io_lrp 0x0002 /* priority of sample rate clock */
#define reg1717_io_iw 0x0004 /* input word length, low=16 h=18 */
#define reg1717_io_atc 0x0008 /* attenuation ctrl. 0=individual
1=left+right controlled by reg0 */
#define reg1717_io_output_mute 0x0000 /* all mute */
#define reg1717_io_output_m_r 0x0010 /* left is mute , right is right */
#define reg1717_io_output_m_l 0x0020 /* left is mute , right is left */
#define reg1717_io_output_m_a 0x0030 /* left is mute , right is l+r/2 */
#define reg1717_io_output_r_m 0x0040 /* left is right, right is mute */
#define reg1717_io_output_r_r 0x0050 /* left is right, right is right */
#define reg1717_io_output_r_l 0x0060 /* left is right, right is left */
#define reg1717_io_output_r_a 0x0070 /* left is right, right is l+r/2 */
#define reg1717_io_output_l_m 0x0080 /* left is left , right is mute */
#define reg1717_io_output_l_r 0x0090 /* left is left , right is right */
#define reg1717_io_output_l_l 0x00A0 /* left is left , right is left */
#define reg1717_io_output_l_a 0x00B0 /* left is left , right is l+r/2 */
#define reg1717_io_output_a_m 0x00C0 /* left is l+r/2, right is mute */
#define reg1717_io_output_a_r 0x00D0 /* left is l+r/2, right is right */
#define reg1717_io_output_a_l 0x00E0 /* left is l+r/2, right is left */
#define reg1717_io_output_a_a 0x00F0 /* left is l+r/2, right is l+r/2 */
#define reg1717_io_normal (reg1717_io_output_l_r | \
reg1717_io_atc /* | \
reg1717_io_iis*/ ) /* 99 */
#ifdef ENABLE_RX
static volatile ulong rx_released; /* Counter of released BDs */
static volatile ulong rx_assigned; /* Counter of BDs to be assigned */
static volatile ulong rx_data; /* Counter of BDs read */
#endif
static volatile ulong tx_released; /* Counter of released BDs */
static volatile ulong tx_assigned; /* Counter of BDs to be assigned */
#ifdef DEBUG_LOST_INT
static volatile int tx_int;
static volatile ulong tx_acount; /* real number of assigned BDs */
#endif
static int txtask;
static int initiator_tx;
#ifdef ENABLE_RX
static int rxtask;
static int initiator_rx;
#endif
static int psc_num;
static unsigned long i2s_is_open;
static int configured=0;
static int once;
static int sample_rate = 44100;
static int mixer_dev_id;
static int blinken = 0;
static int beep_duration = 0;
static struct i2s_ioctl defaults;
static DECLARE_WAIT_QUEUE_HEAD(WaitQ);
static void i2s_start_rx_tx (int task);
static void psc_enable(void);
DECLARE_WAIT_QUEUE_HEAD (i2s_wait_tx);
#ifdef ENABLE_RX
DECLARE_WAIT_QUEUE_HEAD (i2s_wait_rx);
#endif
extern int mgt_sdma_load_tasks_image(void);
struct i2s_buffer {
char *va;
dma_addr_t pa;
size_t len;
};
static void timer_int(void *nothing);
static inline void wait(void) { udelay(I2S_WAIT); }
static int i2s_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg);
static struct tq_struct Task = {
routine: (void(*)(void *)) timer_int, /* The function to run */
data: NULL
};
static struct i2s_buffer i2s_tx_bufs[MAX_DMA_BUFFERS];
#ifdef ENABLE_RX
static struct i2s_buffer i2s_rx_bufs[MAX_DMA_BUFFERS];
#endif
/* --------------- */
/* ML = frame sync */
/* --------------- */
static void ml_low(void) { /* GPIO Timer 4 */
u32 gpt4;
gpt4=*(volatile u32 *)MPC5xxx_GPT4_ENABLE; /* get initial value */
gpt4&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt4|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT4_ENABLE=gpt4;
}
static void ml_high(void){
u32 gpt4;
gpt4=*(volatile u32 *)MPC5xxx_GPT4_ENABLE; /* get initial value */
gpt4&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt4|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT4_ENABLE=gpt4;
}
/* --------------- */
/* MC = clock */
/* --------------- */
static void mc_low(void) { /* GPIO Timer 3 */
u32 gpt3;
gpt3=*(volatile u32 *)MPC5xxx_GPT3_ENABLE; /* get initial value */
gpt3&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt3|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT3_ENABLE=gpt3;
}
static void mc_high(void){
u32 gpt3;
gpt3=*(volatile u32 *)MPC5xxx_GPT3_ENABLE; /* get initial value */
gpt3&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt3|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT3_ENABLE=gpt3;
}
/* --------------- */
/* MD = data */
/* --------------- */
static void md_low(void) { /* GPIO Timer 5 */
u32 gpt5;
gpt5=*(volatile u32 *)MPC5xxx_GPT5_ENABLE; /* get initial value */
gpt5&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt5|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT5_ENABLE=gpt5;
}
static void md_high(void){
u32 gpt5;
gpt5=*(volatile u32 *)MPC5xxx_GPT5_ENABLE; /* get initial value */
gpt5&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt5|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT5_ENABLE=gpt5;
}
/* --------------- */
/* RSTB = Reset */
/* --------------- */
static void snd_reset(void) { /* GPIO Timer 2 */
u32 gpt2;
gpt2=*(volatile u32 *)MPC5xxx_GPT2_ENABLE; /* get initial value f0000620 */
gpt2&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt2|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT2_ENABLE=gpt2;
}
static void snd_normal(void) {
u32 gpt2;
gpt2=*(volatile u32 *)MPC5xxx_GPT2_ENABLE; /* get initial value */
gpt2&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt2|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT2_ENABLE=gpt2;
}
/* --------------- */
/* Blinken Licht */
/* --------------- */
static void blinken_off(void) { /* GPIO Timer 0 */
u32 gpt0;
gpt0=*(volatile u32 *)MPC5xxx_GPT0_ENABLE; /* get initial value */
gpt0&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt0|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT0_ENABLE=gpt0;
}
static void blinken_on(void) {
u32 gpt0;
gpt0=*(volatile u32 *)MPC5xxx_GPT0_ENABLE; /* get initial value */
gpt0&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt0|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT0_ENABLE=gpt0;
}
/* --------------- */
/* Beeper */
/* --------------- */
static void beeper_off(void) { /* GPIO Timer 0 */
u32 gpt7;
gpt7=*(volatile u32 *)MPC5xxx_GPT7_ENABLE; /* get initial value */
gpt7&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt7|=0x00000024; /* Set as a GPIO and set the value to zero */
*(volatile u32 *)MPC5xxx_GPT7_ENABLE=gpt7;
}
static void beeper_on(void) {
u32 gpt7;
gpt7=*(volatile u32 *)MPC5xxx_GPT7_ENABLE; /* get initial value */
gpt7&=0xffffff00; /* clear the lower bits, preserve the upper bits */
gpt7|=0x00000034; /* Set as a GPIO and set the value to one */
*(volatile u32 *)MPC5xxx_GPT7_ENABLE=gpt7;
}
/* ------------------------------------------------------------------------- */
/* i2s_sendbit */
/* ------------------------------------------------------------------------- */
static void i2s_sendbit(int bit, int bit_num)
{
mc_low();
wait();
if (bit)
md_high();
else
md_low();
wait();
wait();
mc_high();
wait();
if (bit_num==0)
ml_low();
wait();
if (bit_num==0) {
wait();
ml_high();
}
}
/* ------------------------------------------------------------------------- */
/* i2s_sendword */
/* ------------------------------------------------------------------------- */
static void i2s_sendword(unsigned short word)
{
static int i,v;
ml_high();
for (i=15; i>=0; i--) {
v=(word>>i) & 0x00000001;
i2s_sendbit(v,i);
}
wait();
wait();
wait();
wait();
}
/* ------------------------------------------------------------------------- */
/* tipcm1717setregister */
/* ------------------------------------------------------------------------- */
static void tipcm1717setregister(unsigned short reg,unsigned short val)
{
static short regval;
regval=(val | (reg<<9));
i2s_sendword(regval);
}
/* ------------------------------------------------------------------------- */
/* mixer routines */
/* ------------------------------------------------------------------------- */
static int ssp_open_mixdev(struct inode *inode, struct file *file)
{
return 0;
}
static int ssp_release_mixdev(struct inode *inode, struct file *file)
{
return 0;
}
static struct file_operations ssp_mixer_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
ioctl: i2s_ioctl,
open: ssp_open_mixdev,
release: ssp_release_mixdev,
};
/* ------------------------------------------------------------------------- */
/* ssp_audio_reset */
/* ------------------------------------------------------------------------- */
static void ssp_audio_reset(void)
{
int flags;
local_irq_save(flags);
udelay(100);
snd_reset();
udelay(100);
snd_normal();
udelay(500); /* give the dac time to settle */
local_irq_restore(flags);
}
/* ------------------------------------------------------------------------- */
/* ssp_audio_init */
/* ------------------------------------------------------------------------- */
static void ssp_audio_init(void)
{
int flags;
/*
Note from Bob Peterson (ACD): According to EJ:
The [TI PCM1717] audio DAC for [our] PowerPC [board] is on PSC2.
It will run in i2s mode. The pin functions are documented on Page 2-34
(PDF page 80) of the MPC5200 User Manual.
I expect to run it in "Codec2 with MCLK" mode, with i2s data formatting.
See chapter 15 for PSC setup details. [pp 501-555]
We need to program the MCLK signal to have a clock of close to
11.2896 MHz (we may have to be a small bit off to make the numbers work,
the target is a 44.1 KHz sample rate times 256).
This means we'll need to set the Serial Interface Control Register to:
-first bit of first time slow of a new frame starts one bit clock cycle
after the rising edge of frame sync.
-MSB first
-Codec mode, 32-bit data
-use bit clock and frame sync generated internally from MCLK. */
local_irq_save(flags);
/* set the initial volume */
tipcm1717setregister(reg1717_vol_l, 0x0008 | reg1717_vol_ldl);
tipcm1717setregister(reg1717_vol_r, 0x0008 | reg1717_vol_ldl);
tipcm1717setregister(reg1717_mute, 0x0000);
tipcm1717setregister(reg1717_io_fmt, reg1717_io_normal);
local_irq_restore(flags);
}
/* ------------------------------------------------------------------------- */
/* original i2s routines start here */
/* ------------------------------------------------------------------------- */
static int i2s_buffers_init(void)
{
int i;
for (i = 0; i < MAX_DMA_BUFFERS; i++) {
if ((i2s_tx_bufs[i].va =
pci_alloc_consistent(NULL, BUFSIZE, &i2s_tx_bufs[i].pa)) == NULL) {
printk("Error: unable to allocate tx buffer #%d.\n",i+1);
return -1;
}
#ifdef ENABLE_RX
if ((i2s_rx_bufs[i].va =
pci_alloc_consistent(NULL, BUFSIZE, &i2s_rx_bufs[i].pa)) == NULL) {
printk("Error: unable to allocate rx buffer #%d.\n",i+1);
return -1;
}
#endif
}
return 0;
}
/* ------------------------------------------------------------------------- */
/* i2s_buffers_release */
/* ------------------------------------------------------------------------- */
static int i2s_buffers_release(void)
{
int i;
for (i = 0; i < MAX_DMA_BUFFERS; i++) {
pci_free_consistent(NULL, BUFSIZE, i2s_tx_bufs[i].va, i2s_tx_bufs[i].pa);
TaskBDRelease(txtask);
#ifdef ENABLE_RX
pci_free_consistent(NULL, BUFSIZE, i2s_rx_bufs[i].va, i2s_rx_bufs[i].pa);
TaskBDRelease(rxtask);
#endif
}
return 0;
}
/* ------------------------------------------------------------------------- */
/* i2s_tx_irq - handle transmit interrupt */
/* ------------------------------------------------------------------------- */
static void i2s_tx_irq(int irq, void *dev_id, struct pt_regs *regs)
{
int bdnum;
#ifdef DEBUG_LOST_INT
tx_int = 1;
#endif
TaskIntClear(txtask);
if (tx_assigned == tx_released) {
printk("%s: %ld:%ld - false int??\n",__FUNCTION__,tx_assigned,tx_released);
return;
}
while ((bdnum = TaskBDRelease(txtask))>=0) {
tx_released++;
if (tx_released>100*MAX_DMA_BUFFERS) { /* make sure our numbers never wrap to negative */
tx_released-=98*MAX_DMA_BUFFERS;
tx_assigned-=98*MAX_DMA_BUFFERS;
}
if (bdnum != tx_released % MAX_DMA_BUFFERS)
printk("%s: %d:%ld\n", __FUNCTION__,bdnum,tx_released % MAX_DMA_BUFFERS);
WDPRINTK("%s: released bd %d\n", __FUNCTION__,
(bdnum + MAX_DMA_BUFFERS - 1) % MAX_DMA_BUFFERS);
} /* while */
wake_up(&i2s_wait_tx);
}
#ifdef ENABLE_RX
/* ------------------------------------------------------------------------- */
/* i2s_rx_irq */
/* ------------------------------------------------------------------------- */
static void i2s_rx_irq(int irq, void *dev_id, struct pt_regs *regs)
{
int bdnum;
if (rx_assigned == rx_released) {
printk("%s: %ld:%ld - false int??\n", __FUNCTION__, rx_assigned, rx_released);
return;
}
TaskIntClear(rxtask);
bdnum = TaskBDRelease(rxtask);
rx_released++;
if (bdnum != rx_released % MAX_DMA_BUFFERS)
printk("%s: %d:%ld\n", __FUNCTION__, bdnum, rx_released % MAX_DMA_BUFFERS);
RDPRINTK("%s: released bd %d\n", __FUNCTION__,
(bdnum + MAX_DMA_BUFFERS - 1) % MAX_DMA_BUFFERS);
if (rx_assigned > rx_released) {
bdnum=TaskBDAssign(rxtask, (void *)i2s_rx_bufs[bdnum].pa, NULL, BUFSIZE,0);
RDPRINTK("%s: assigned bd %d\n", __FUNCTION__, bdnum);
}
wake_up(&i2s_wait_rx);
}
#endif
/* ------------------------------------------------------------------------- */
/**
* i2s_write:
* @file: file handle
* @buf: buffer to write (unused as data does not matter here
* @count: count of bytes
* @ppos: pointer to the position to write. No seeks allowed
*
*/
/* ------------------------------------------------------------------------- */
static ssize_t i2s_write(struct file *file, const char *buf, size_t count,
loff_t *ppos)
{
size_t cnt = count;
size_t tc;
char *ptr = (char *)buf;
int bdnum, err;
int n, flags;
if (!configured) {
printk("i2s: write when not configured.\n");
return -EINVAL;
}
/* Can't seek (pwrite) on this device */
if (ppos != &file->f_pos) {
printk("i2s: Can't seek (pwrite) on this device.\n");
return -ESPIPE;
}
if (once) {
/*printk("i2s: First write: starting rx_tx task.\n");*/
i2s_start_rx_tx(txtask);
once = 0;
}
/*WDPRINTK("%s: count %d\n", __FUNCTION__, count);*/
while(cnt) {
/* Wait until all buffers will be released */
/*err = wait_event_interruptible(i2s_wait_tx, tx_assigned==tx_released);*/
/* Wait until the number of buffers assigned is less than the */
/* number of buffers released plus the size of the buffer queue. */
/*printk("W: Assigned: %d Released: %d\n",tx_assigned,tx_released);*/
if (tx_assigned-tx_released>=MAX_DMA_BUFFERS) {
err = wait_event_interruptible(i2s_wait_tx,
tx_assigned-tx_released<MAX_DMA_BUFFERS);
if (err) {
#ifdef DEBUG_LOST_INT
printk("%s: interrupted, %ld:%ld:%ld, tx_int %d, err %d\n",
__FUNCTION__,tx_assigned, tx_acount, tx_released, tx_int, err);
#endif
break;
}
}
/* prefill the buffers */
tc = (cnt > BUFSIZE) ? BUFSIZE : cnt;
if (copy_from_user(i2s_tx_bufs[tx_assigned % MAX_DMA_BUFFERS].va,
ptr, tc)) {
err = -EFAULT;
break;
}
i2s_tx_bufs[tx_assigned % MAX_DMA_BUFFERS].len = tc;
n = tx_assigned % MAX_DMA_BUFFERS;
tx_assigned++;
ptr += tc;
cnt -= tc;
/* Now assign the first buffer to the Bestcomm task */
save_flags(flags);cli(); /* Bestcomm can lose interrupts otherwise ??? */
#ifdef DEBUG_LOST_INT
tx_int = 0;
tx_acount++;
#endif
// Note from Bob: bd = Buffer Descriptor
bdnum = TaskBDAssign(txtask, (void *)i2s_tx_bufs[n].pa, NULL,
i2s_tx_bufs[n].len, 0);
restore_flags(flags);
if (bdnum < 0) {
printk("%s:TaskBDAssign error %d(tx stuck??)\n", __FUNCTION__, bdnum);
return -EIO;
}
WDPRINTK("%s: assigned bd %d (buf %d), tc %d\n", __FUNCTION__,
bdnum, n, tc);
}
/*WDPRINTK("%s: sent %d, err %d\n", __FUNCTION__, count - cnt, err);*/
return (count - cnt) ? (count - cnt) : err;
} /* i2s_write */
/* ------------------------------------------------------------------------- */
/**
* i2s_read:
* @file: file handle
* @buf: buffer to read
* @count: length of buffer
* @ptr: offset (no seek allowed)
*
*/
/* ------------------------------------------------------------------------- */
static ssize_t i2s_read(struct file *file, char *buf,size_t count,loff_t *ppos)
{
#ifdef ENABLE_RX
size_t cnt = count;
char *ptr = buf;
size_t bd_count;
int bdnum;
int err;
if (!configured)
return -EINVAL;
/* Can't seek (pread) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;
if (once) {
i2s_start_rx_tx(rxtask);
once = 0;
}
while (cnt) {
/* How much BDs are needed (up to MAX_DMA_BUFFERS) */
bd_count = (cnt + BUFSIZE - 1) / BUFSIZE;
if (bd_count > MAX_DMA_BUFFERS)
bd_count = MAX_DMA_BUFFERS;
rx_assigned += bd_count;
RDPRINTK("%s: cnt %d, rx_data %ld, ass %ld, rel %ld\n", __FUNCTION__, cnt,
rx_data, rx_assigned, rx_released);
/* Start reading the data */
bdnum = TaskBDAssign(rxtask,
(void *)i2s_rx_bufs[rx_released % MAX_DMA_BUFFERS].pa,
NULL, BUFSIZE, 0);
if (bdnum < 0) {
printk("%s:TaskBDAssign error %d\n", __FUNCTION__, bdnum);
return -EIO;
}
RDPRINTK("%s:assigned bd %d (buf %ld)\n", __FUNCTION__,
bdnum, rx_assigned % MAX_DMA_BUFFERS);
/* Copy the data to user as it arrives */
while (bd_count--) {
int len;
len = (cnt > BUFSIZE) ? BUFSIZE : cnt;
RDPRINTK("%s:to user:rx_data %ld, ass %ld, rel %ld\n",
__FUNCTION__, rx_data,
rx_assigned, rx_released);
/* Wait at least one BD released */
err = wait_event_interruptible(i2s_wait_rx, rx_data < rx_released);
if(err) {
goto out;
}
if (copy_to_user(ptr, i2s_rx_bufs[rx_data % MAX_DMA_BUFFERS].va, len)) {
err = -EFAULT;
goto out;
}
ptr += len;
cnt -= len;
rx_data ++;
}
}
out:
RDPRINTK("%s: read %d, err %d\n", __FUNCTION__, count - cnt, err);
return (count - cnt) ? (count - cnt) : err;
#else
return -EINVAL;
#endif
}
/* ------------------------------------------------------------------------- */
/* i2s_start_rx_tx */
/* ------------------------------------------------------------------------- */
static void i2s_start_rx_tx(int task)
{
#ifdef ENABLE_RX
if (task == rxtask) {
#ifdef RX_TASK_START
TaskStart(rxtask, TASK_AUTOSTART_ENABLE, rxtask, TASK_INTERRUPT_ENABLE);
#endif
}
#else
if (task == txtask) {
#endif
#ifdef TX_TASK_START
TaskStart(txtask, TASK_AUTOSTART_ENABLE, txtask, TASK_INTERRUPT_ENABLE);
#endif
}
psc_enable();
}
/* ------------------------------------------------------------------------- */
/* psc_enable */
/* ------------------------------------------------------------------------- */
static void psc_enable(void)
{
struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 +
((psc_num - 1) * 0x200));
psc->command = MPC5xxx_PSC_RX_ENABLE | MPC5xxx_PSC_TX_ENABLE;
}
/* ------------------------------------------------------------------------- */
/* psc_reset */
/* ------------------------------------------------------------------------- */
static void psc_reset(void)
{
struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 +
((psc_num - 1) * 0x200));
#ifdef ENABLE_RX
psc->command = MPC5xxx_PSC_RST_RX;
#endif
psc->command = MPC5xxx_PSC_RST_TX;
psc->command = MPC5xxx_PSC_SEL_MODE_REG_1;
psc->command = MPC5xxx_PSC_RST_ERR_STAT;
}
/* ------------------------------------------------------------------------- */
/* i2s_channel_setup */
/* ------------------------------------------------------------------------- */
static int i2s_channel_setup(struct i2s_ioctl *arg)
{
struct mpc5xxx_psc *psc;
struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5xxx_GPIO;
struct mpc5xxx_cdm *cdm = (struct mpc5xxx_cdm *)MPC5xxx_CDM;
TaskSetupParamSet_t i2s_setup_tx;
#ifdef ENABLE_RX
TaskSetupParamSet_t i2s_setup_rx;
#endif
if (arg->psc_num < 1 || arg->psc_num > 3) {
printk("i2s: Invalid psc specified during channel_setup.\n");
return -EINVAL;
}
psc_num = arg->psc_num;
switch (psc_num) {
case 1:
initiator_tx = INITIATOR_PSC1_TX;
#ifdef ENABLE_RX
initiator_rx = INITIATOR_PSC1_RX;
#endif
cdm->mclken_div_psc1 |= (0x8000 | arg->mclk_div);
break;
case 2:
initiator_tx = INITIATOR_PSC2_TX;
#ifdef ENABLE_RX
initiator_rx = INITIATOR_PSC2_RX;
#endif
cdm->mclken_div_psc2 = (0x8000 | arg->mclk_div);
break;
case 3:
initiator_tx = INITIATOR_PSC3_TX;
#ifdef ENABLE_RX
initiator_rx = INITIATOR_PSC3_RX;
#endif
cdm->mclken_div_psc3 |= (0x8000 | arg->mclk_div);
break;
}
psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 + ((psc_num - 1) * 0x200));
/* disable Tx & Rx */
psc->command = (MPC5xxx_PSC_TX_DISABLE | MPC5xxx_PSC_RX_DISABLE);
gpio->port_config &= ~(0x7 << ((psc_num - 1) * 4));
gpio->port_config &= 0xcfffffff; /* Turn off ALTS */
if (arg->mclk) {
gpio->port_config|=(0x7 << ((arg->psc_num-1)*4)); /* CODEC with MCLK */
} else {
gpio->port_config|=(0x6 << ((arg->psc_num-1)*4)); /* CODEC without MCLK */
}
cdm->clk_enables |= (1 << (arg->psc_num + 4)); /* PSC clock enable */
/* reset PSC */
psc_reset();
psc->mode = 0;
psc->rfalarm = 0x120; /* alarm threshold level */
psc->tfalarm = 0x120;
psc->rfcntl = 4; /* granularity */
psc->tfcntl = 4;
psc->mpc5xxx_psc_imr = 0; /* disable interrupts */
/* Configure codec parameters (MSB first) */
switch (arg->data_width) {
case 8:
psc->sicr = 0x01000000;
psc->ctur = 0x7; /* 8 bits per frame */
break;
case 16:
psc->sicr = 0x02000000; /* 004xxxxx=multi word*/
psc->ctur = 0xf; /* 0xf; 16 bits per frame */
break;
case 24:
psc->sicr = 0x07000000;
psc->ctur = 0x17; /* 24 bits per frame */
break;
case 32:
psc->sicr = 0x0f000000;
psc->ctur = 0x1f; /* 32 bits per frame: set frame width to 32 sclks */
break;
default:
printk("Invalid data_width specified.\n");
return -EINVAL;
}
psc->ccr = (arg->frsync_div*0x100) + arg->bclk_div;
/* Bob note: I think ccr must be a write-only register. It comes back 0. */
/* However, the databook seems to indicate r/w. Not sure why. */
/* DTS = 1, Data MSB first, use 5200 clk and frame sync, multiword.
* Frame sync active low, data sampled on CLK high.
*/
psc->sicr |= /*DELAY_TIME_SLOT |*/ MULTIWD_ENABLE | CLK_POL_RISING;
if (arg->master) /* Master mode - PSC will drive SCLK and LRCK */
psc->sicr |= GEN_CLK_INT;
/* reset PSC again */
psc_reset();
/* setup the tasks */
memset(&i2s_setup_tx, 0, sizeof(i2s_setup_tx));
i2s_setup_tx.Initiator = (MPC5200Initiator_t)(initiator_tx);
i2s_setup_tx.NumBD = MAX_DMA_BUFFERS;
i2s_setup_tx.Size.MaxBuf = BUFSIZE;
i2s_setup_tx.StartAddrDst = (volatile u32)&(psc->tfdata);
i2s_setup_tx.IncrSrc = arg->data_width/8; /* added by Bob: was 4 */
i2s_setup_tx.IncrDst = 0;
i2s_setup_tx.SzSrc = arg->data_width/8; /* was 4 */
i2s_setup_tx.SzDst = arg->data_width/8; /* was 4 */
txtask = TaskSetup(TASK_GEN_TX_BD, &i2s_setup_tx);
if (request_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, i2s_tx_irq,
SA_INTERRUPT, "i2s tx dma", NULL)) {
printk(KERN_ERR "i2s: SDMA tx irq allocation failed\n");
return -EINVAL;
}
#ifdef ENABLE_RX
memset(&i2s_setup_rx, 0, sizeof(i2s_setup_rx));
i2s_setup_rx.Initiator = (MPC5200Initiator_t)(initiator_rx);
i2s_setup_rx.NumBD = MAX_DMA_BUFFERS;
i2s_setup_rx.Size.MaxBuf = BUFSIZE;
i2s_setup_rx.StartAddrSrc = (volatile u32)&(psc->rfdata);
i2s_setup_rx.IncrDst = 4;
i2s_setup_rx.IncrSrc = 0;
i2s_setup_rx.SzDst = 4;
rxtask = TaskSetup(TASK_GEN_RX_BD, &i2s_setup_rx);
if (request_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, i2s_rx_irq,
SA_INTERRUPT, "i2s rx dma", NULL)) {
printk(KERN_ERR "i2s: SDMA rx irq allocation failed\n");
return -EINVAL;
}
#endif
configured = 1;
return 0;
}/* i2s_channel_setup */
/* ------------------------------------------------------------------------- */
/**
* i2s_ioctl:
* @inode: inode of the device
* @file: file handle to the device
* @arg: argument pointer
*/
/* ------------------------------------------------------------------------- */
static int i2s_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
long val;
int ret;
struct i2s_ioctl i2s_arg;
static int *intpnd,*intmsk;
switch (cmd) {
case I2S_SET_CHANNEL:
if (copy_from_user (&i2s_arg, (struct i2s_ioctl *)arg, sizeof(i2s_arg)))
return -EFAULT;
ret = i2s_channel_setup(&i2s_arg);
break;
case I2S_DEBUG:
intpnd=(int *)(0xf0001214);
intmsk=(int *)(0xf0001218);
printk("txtask=%d INTPND=%08X INTMSK=%08X\n",
txtask,(unsigned int)*intpnd,(unsigned int)*intmsk);
printk("Assigned=%ld Released=%ld\n",tx_assigned,tx_released);
break;
case I2S_BEEP:
if (arg)
beep_duration=(int)arg;
else
beep_duration=BEEP_DURATION; /* in 100ths of a second */
beeper_on();
break;
case I2S_RESET:
ssp_audio_reset();
break;
case SNDCTL_DSP_STEREO:
ret = get_user(val, (int *) arg);
if (ret)
return ret;
/* Simple standard DACs are stereo only */
ret = (val == 0) ? -EINVAL : 1;
return put_user(ret, (int *) arg);
case SNDCTL_DSP_CHANNELS:
case SOUND_PCM_READ_CHANNELS:
/* Simple standard DACs are stereo only */
return put_user(2, (long *) arg);
case SNDCTL_DSP_SPEED:
case SOUND_PCM_READ_RATE:
/* We assume the clock doesn't change */
return put_user(sample_rate, (long *) arg);
case SNDCTL_DSP_SETFMT:
if (arg!=AFMT_S16_BE) { /* if not signed 16-bit big-endian */
printk("SNDCTL_DSP_SETFMT: request for 0x%08X rejected.\n",arg);
return -1;
}
/* Simple standard DACs are 16-bit only */
return put_user(16, (long *) arg);
case SNDCTL_DSP_GETFMTS:
/* Simple standard DACs are 16-bit only */
return put_user(16, (long *) arg);
case SNDCTL_DSP_SYNC:
wait_event_interruptible(i2s_wait_tx,tx_assigned==tx_released);
return 0;
case SOUND_MIXER_WRITE_VOLUME:
tipcm1717setregister(reg1717_vol_l, (unsigned short)arg | reg1717_vol_ldl);
tipcm1717setregister(reg1717_vol_r, (unsigned short)arg | reg1717_vol_ldl);
return 0;
case SNDCTL_DSP_GETOSPACE:
{
audio_buf_info inf = { 0, };
int i;
if (!(file->f_mode & FMODE_WRITE))
return -EINVAL;
inf.fragments=MAX_DMA_BUFFERS-(tx_assigned-tx_released);
inf.bytes = BUFSIZE*(MAX_DMA_BUFFERS-(tx_assigned-tx_released));
inf.fragstotal = MAX_DMA_BUFFERS;
inf.fragsize = BUFSIZE;
return copy_to_user((void *)arg, &inf, sizeof(inf));
}
case SNDCTL_DSP_GETODELAY:
if (!(file->f_mode & FMODE_WRITE))
return -EINVAL;
put_user(BUFSIZE*(tx_assigned-tx_released), (int *)arg);
return 0;
default:
ret = -EINVAL;
break;
}
return ret;
}
/* ------------------------------------------------------------------------- */
/**
* i2s_open:
* @inode: inode of device
* @file: file handle to device
*/
/* ------------------------------------------------------------------------- */
static int i2s_open(struct inode *inode, struct file *file)
{
if(test_and_set_bit(0, &i2s_is_open))
return -EBUSY;
i2s_channel_setup(&defaults);
ssp_audio_init();
i2s_is_open = 1;
tx_assigned = tx_released = 0;
#ifdef ENABLE_RX
rx_assigned = rx_released = 0;
rx_data = 0;
#endif
#ifdef DEBUG_LOST_INT
tx_acount = 0;
#endif
once = 1;
return 0;
}
/* ------------------------------------------------------------------------- */
/**
* i2s_release
* @inode: inode to board
* @file: file handle to board
*/
/* ------------------------------------------------------------------------- */
static int i2s_release(struct inode *inode, struct file *file)
{
wait_event_interruptible(i2s_wait_tx, tx_assigned == tx_released);
psc_reset();
#ifdef ENABLE_RX
if (rxtask) {
TaskStop(rxtask);
free_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, NULL);
rxtask = 0;
}
#endif
if (txtask) {
TaskStop(txtask);
free_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, NULL);
TaskBDReset(txtask);
txtask = 0;
}
configured = 0;
clear_bit(0, &i2s_is_open);
return 0;
}
/* ------------------------------------------------------------------------- */
/* i2s_poll */
/* ------------------------------------------------------------------------- */
static unsigned int i2s_poll(struct file *file, poll_table *wait)
{
int ret = 0;
if (configured) {
ret = (POLLIN | POLLRDNORM);
}
return ret;
}
static struct file_operations i2s_fops = {
owner: THIS_MODULE,
llseek: no_llseek,
read: i2s_read,
write: i2s_write,
ioctl: i2s_ioctl,
open: i2s_open,
release: i2s_release,
poll: i2s_poll,
};
static struct miscdevice i2s_miscdev=
{
I2S_MINOR,
"I2S",
&i2s_fops
};
/* ------------------------------------------------------------------------- */
/*
* cleanup_module:
*/
/* ------------------------------------------------------------------------- */
static void __exit i2s_exit(void)
{
misc_deregister(&i2s_miscdev);
i2s_buffers_release();
TaskStop(txtask);
free_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, NULL);
#ifdef ENABLE_RX
TaskStop(rxtask);
free_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, NULL);
#endif
}
/* ------------------------------------------------------------------------- */
/*
* i2s_init:
*/
/* ------------------------------------------------------------------------- */
static int __init i2s_init(void)
{
static int ret;
/*struct mpc5xxx_intr *int_ctrl;*/
/*sdma_regs *sdma = (sdma_regs *)MPC5xxx_SDMA;*/
struct mpc5xxx_cdm *cdm = (struct mpc5xxx_cdm *)MPC5xxx_CDM;
printk("i2s.c: audio device driver for PowerPC.\n");
cdm->pci_clk_sel&=0xfffffffc; /* Speed up the pci clock by factor of 2*/
udelay(50); /* wait just a little */
ret = misc_register(&i2s_miscdev);
if (ret) {
printk(KERN_ERR "i2s: can't misc_register on minor=%d\n", I2S_MINOR);
goto out;
}
i2s_buffers_init();
defaults.psc_num=2;
defaults.mclk_div=0x2e;
defaults.mclk=1;
defaults.data_width=16;
defaults.frsync_div=0x1f;
defaults.bclk_div=7;
defaults.master=1;
printk("We have audio for mpc5200!\n");
mixer_dev_id = register_sound_mixer(&ssp_mixer_fops, -1);
/*printk( KERN_INFO "Mixer registered. id=%d\n",mixer_dev_id);*/
/*printk(KERN_INFO "Initializing pcm1717 chip.\n");*/
ssp_audio_reset();
ssp_audio_init();
/* int_ctrl=(struct mpc5xxx_intr *)MPC5xxx_INTR; * MBAR_INT_CTRL */
/* int_ctrl->pimsk &= (~(PIMSK_BESTCOMM)); */
/* Bob: Assume that u-boot has initialized Bestcomm for the purposes */
/* of dmaing to and from the ethernet FEC. */
TasksInitAPI((uint8 *)MPC5xxx_MBAR); /* Still needed */
/* sdma->taskBar = MPC5xxx_SRAM; */
/* TasksLoadImage(sdma); */
ret = 0;
printk(KERN_INFO "MPC5200 I2S driver (%d BDs x %d bytes).\n",
MAX_DMA_BUFFERS, BUFSIZE);
/* --------------------------------------------------------------------- */
/* Install our timer interrupt routine */
/* --------------------------------------------------------------------- */
queue_task(&Task, &tq_timer);
out:
return ret;
}
/* ------------------------------------------------------------------------ */
/* timer_int - Timer Interrupt */
/* ------------------------------------------------------------------------ */
static void timer_int(void *nothing)
{
if (beep_duration>0) {
beep_duration--; /* in 100ths of a second */
if (!beep_duration)
beeper_off();
}
if (waitqueue_active(&WaitQ)) /* if Cleanup wants us to die */
wake_up(&WaitQ); /* Now cleanup_module can return */
else
queue_task(&Task, &tq_timer); /* put ourselves back in the task queue. */
}
module_init(i2s_init);
module_exit(i2s_exit);
MODULE_DESCRIPTION("Simple driver for the MPC5200 PSC in CODEC I2S mode.\n");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply
* Re: [PATCH] ppc32: cleanup AMCC PPC4xx eval boards to better support U-Boot
From: Eugene Surovegin @ 2005-09-16 16:27 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-embedded
In-Reply-To: <200509161306.17103.sr@denx.de>
On Fri, Sep 16, 2005 at 01:06:16PM +0200, Stefan Roese wrote:
> Add U-Boot support to AMCC PPC405 eval boards (bubinga, sycamore and walnut)
> and cleanup PPC440 eval boards (bamboo, ebony, luan and ocotea) to better
> support U-Boot as bootloader.
In general, 44x pieces look OK, but 40x aren't. Notice, that we don't
have any #ifdef CONFIG_UBOOT in 44x sources. Let's not add them for
40x, try to replicate the same boot-wrapper approach as Matt used for
44x.
[snip]
> diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
> --- a/arch/ppc/platforms/4xx/Kconfig
> +++ b/arch/ppc/platforms/4xx/Kconfig
> @@ -212,10 +212,18 @@ config EMBEDDEDBOOT
> depends on EP405 || XILINX_ML300
> default y
>
> -config IBM_OPENBIOS
> - bool
> +choice
> + prompt "Bootloader support"
> depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
> - default y
> + default IBM_OPENBIOS
> +
> +config IBM_OPENBIOS
> + bool "IBM OpenBIOS"
> +
> +config UBOOT
> + bool "U-Boot"
> +
> +endchoice
Do we really need this? U-Boot build is different from OpenBIOS
already (we just use vmlinux without any boot-wrapper) and is selected
by different make target.
[snip]
> --- a/arch/ppc/platforms/4xx/bubinga.c
> +++ b/arch/ppc/platforms/4xx/bubinga.c
> @@ -89,7 +89,11 @@ bubinga_early_serial_map(void)
> * by 16.
> */
> uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV);
> +#ifdef CONFIG_UBOOT
> + uart_clock = __res.bi_procfreq / uart_div;
> +#else
> uart_clock = __res.bi_pllouta_freq / uart_div;
> +#endif
Why not just rename this field and skip this ugly ifdefing?
--
Eugene
^ permalink raw reply
* Reminder: removal of APUS and Gemini still pending
From: Kumar Gala @ 2005-09-16 16:36 UTC (permalink / raw)
To: ppc-dev list
This is a reminder email to all those that care that APUS and Gemini
configs are still not building in the kernel. They are still
scheduled to be removed after the release of 2.6.15.
- kumar
^ permalink raw reply
* [PATCH] ppc32: Removed non-inlined versions of local_irq* functions
From: Kumar Gala @ 2005-09-16 16:37 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
We always use the inlined versions of local_irq_enable, local_irq_disable,
local_save_flags_ptr, and local_irq_restore on ppc32 so the non-inlined
versions where just taking up space.
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---
commit d32a678da44acac59f2767d7437466ab0db90de1
tree 8abc5e2e4846159c467f38ef63c1cda0fc70fdcc
parent 065d9cac98a5406ecd5a1368f8fd38f55739dee9
author Kumar K. Gala <kumar.gala@freescale.com> Fri, 16 Sep 2005 11:30:25 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Fri, 16 Sep 2005 11:30:25 -0500
arch/ppc/kernel/misc.S | 128 -------------------------------------------
arch/ppc/kernel/ppc_ksyms.c | 10 ---
include/asm-ppc/hw_irq.h | 16 -----
3 files changed, 0 insertions(+), 154 deletions(-)
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -273,134 +273,6 @@ _GLOBAL(low_choose_7447a_dfs)
#endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
-/* void local_save_flags_ptr(unsigned long *flags) */
-_GLOBAL(local_save_flags_ptr)
- mfmsr r4
- stw r4,0(r3)
- blr
- /*
- * Need these nops here for taking over save/restore to
- * handle lost intrs
- * -- Cort
- */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
-_GLOBAL(local_save_flags_ptr_end)
-
-/* void local_irq_restore(unsigned long flags) */
-_GLOBAL(local_irq_restore)
-/*
- * Just set/clear the MSR_EE bit through restore/flags but do not
- * change anything else. This is needed by the RT system and makes
- * sense anyway.
- * -- Cort
- */
- mfmsr r4
- /* Copy all except the MSR_EE bit from r4 (current MSR value)
- to r3. This is the sort of thing the rlwimi instruction is
- designed for. -- paulus. */
- rlwimi r3,r4,0,17,15
- /* Check if things are setup the way we want _already_. */
- cmpw 0,r3,r4
- beqlr
-1: SYNC
- mtmsr r3
- SYNC
- blr
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
-_GLOBAL(local_irq_restore_end)
-
-_GLOBAL(local_irq_disable)
- mfmsr r0 /* Get current interrupt state */
- rlwinm r3,r0,16+1,32-1,31 /* Extract old value of 'EE' */
- rlwinm r0,r0,0,17,15 /* clear MSR_EE in r0 */
- SYNC /* Some chip revs have problems here... */
- mtmsr r0 /* Update machine state */
- blr /* Done */
- /*
- * Need these nops here for taking over save/restore to
- * handle lost intrs
- * -- Cort
- */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
-_GLOBAL(local_irq_disable_end)
-
-_GLOBAL(local_irq_enable)
- mfmsr r3 /* Get current state */
- ori r3,r3,MSR_EE /* Turn on 'EE' bit */
- SYNC /* Some chip revs have problems here... */
- mtmsr r3 /* Update machine state */
- blr
- /*
- * Need these nops here for taking over save/restore to
- * handle lost intrs
- * -- Cort
- */
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
-_GLOBAL(local_irq_enable_end)
-
/*
* complement mask on the msr then "or" some values on.
* _nmask_and_or_msr(nmask, value_to_or)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -272,16 +272,6 @@ EXPORT_SYMBOL(screen_info);
#endif
EXPORT_SYMBOL(__delay);
-#ifndef INLINE_IRQS
-EXPORT_SYMBOL(local_irq_enable);
-EXPORT_SYMBOL(local_irq_enable_end);
-EXPORT_SYMBOL(local_irq_disable);
-EXPORT_SYMBOL(local_irq_disable_end);
-EXPORT_SYMBOL(local_save_flags_ptr);
-EXPORT_SYMBOL(local_save_flags_ptr_end);
-EXPORT_SYMBOL(local_irq_restore);
-EXPORT_SYMBOL(local_irq_restore_end);
-#endif
EXPORT_SYMBOL(timer_interrupt);
EXPORT_SYMBOL(irq_desc);
EXPORT_SYMBOL(tb_ticks_per_jiffy);
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h
--- a/include/asm-ppc/hw_irq.h
+++ b/include/asm-ppc/hw_irq.h
@@ -10,12 +10,8 @@
extern void timer_interrupt(struct pt_regs *);
-#define INLINE_IRQS
-
#define irqs_disabled() ((mfmsr() & MSR_EE) == 0)
-#ifdef INLINE_IRQS
-
static inline void local_irq_disable(void)
{
unsigned long msr;
@@ -45,18 +41,6 @@ static inline void local_irq_save_ptr(un
#define local_irq_save(flags) local_irq_save_ptr(&flags)
#define local_irq_restore(flags) mtmsr(flags)
-#else
-
-extern void local_irq_enable(void);
-extern void local_irq_disable(void);
-extern void local_irq_restore(unsigned long);
-extern void local_save_flags_ptr(unsigned long *);
-
-#define local_save_flags(flags) local_save_flags_ptr(&flags)
-#define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();})
-
-#endif
-
extern void do_lost_interrupts(unsigned long);
#define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);})
^ permalink raw reply
* bseip config doesn't build
From: Kumar Gala @ 2005-09-16 16:41 UTC (permalink / raw)
To: linuxppc-embedded
Anyone have any ideas why the bseip_defconfig doesnt build. I get the
following error:
CC arch/ppc/8xx_io/enet.o
arch/ppc/8xx_io/enet.c:705:2: #error Exactly ONE pair of PA_ENET_[RT]XD, PB_ENET_[RT]XD must be defined
arch/ppc/8xx_io/enet.c: In function `scc_enet_init':
arch/ppc/8xx_io/enet.c:726: error: `PA_ENET_TCLK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:726: error: (Each undeclared identifier is reported only once
arch/ppc/8xx_io/enet.c:726: error: for each function it appears in.)
arch/ppc/8xx_io/enet.c:726: error: `PA_ENET_RCLK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:732: error: `PC_ENET_CLSN' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:732: error: `PC_ENET_RENA' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:739: error: `SICR_ENET_MASK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:740: error: `SICR_ENET_CLKRT' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:918:2: #error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
arch/ppc/8xx_io/enet.c:932: error: `PB_BSE_POWERUP' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:932: error: `PB_BSE_FDXDIS' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:936: error: `PC_BSE_LOOPBACK' undeclared (first use in this function)
make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1
make: *** [arch/ppc/8xx_io] Error 2
- kumar
^ permalink raw reply
* Re: bseip config doesn't build
From: Dan Malek @ 2005-09-16 17:34 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-embedded
In-Reply-To: <Pine.LNX.4.61.0509161138130.20199@nylon.am.freescale.net>
On Sep 16, 2005, at 12:41 PM, Kumar Gala wrote:
> Anyone have any ideas why the bseip_defconfig doesnt build. I get the
> following error:
I'll look into it.
> CC arch/ppc/8xx_io/enet.o
I thought we are should be using the drivers/net/* version of this?
Thanks.
-- Dan
^ permalink raw reply
* Re: OpenSSL 0.9.8 compile error!
From: Ricardo Fialho Tafas Junior @ 2005-09-16 15:34 UTC (permalink / raw)
To: linux-ppc-embedded
In-Reply-To: <023EF71CB65AA949A2C510353690C86B5BF2C0@rokonet-e.rokonet_tree.local>
it worked and compiled ok.
thanks
Ricard Fialho Tafas Jr
R&D Engineer
Parks S.A. Comunicações Digitais
www.parks.com.br
+55 51 4700523
e-mail: rtafas@parks.com.br
Eli Brin wrote:
> Dear Ricardo,
>
> You need to add no-asm (and probably no-hw). Please look at the makefile
> and Configure.
>
> This works on 0.9.7b, but I believe that's you problem.
>
> Eli
>
>
>
> -----Original Message-----
> From: Ricardo Fialho Tafas Junior [mailto:rtafas@parks.com.br]
> Sent: Friday, September 16, 2005 1:19 PM
> To: linux-ppc-embedded
> Subject: OpenSSL 0.9.8 compile error!
>
>
> Hello list,
>
> I'm trying to crosscompile openSSL to PPC8xx. I've downloaded the latest
> version and when I call "make" I get the following error:
>
> ppc_8xx-gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT
> -DDSO_DLFCN -DHAVE_DLFCN_H -DB_ENDIAN -DTERMIO -O3 -Wall -c -o
> linux_ppc32.o linux_ppc32.s
> linux_ppc32.s: Assembler messages:
> linux_ppc32.s:109: Error: Unknown pseudo-op: `.machine'
> make[3]: *** [linux_ppc32.o] Error 1
> make[3]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto/bn'
> make[2]: *** [subdirs] Error 1
> make[2]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto'
> make[1]: *** [build_crypto] Error 1
> make[1]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8'
> make: *** [top] Error 2
>
> Before that:
> I make a "./Configure linux-ppc" and edited the makefile to cross
> compile it and to force it to use ppc-8xx_gcc and ppc_8xx-ar.
>
> Any idea to solve this?
> Any "how to" to compile Openssl in embedded enviroment?
>
> Thanks,
>
^ permalink raw reply
* Re: bseip config doesn't build
From: Kumar Gala @ 2005-09-16 19:29 UTC (permalink / raw)
To: Dan Malek; +Cc: Gala Kumar K.-galak, linuxppc-embedded
In-Reply-To: <580ff9f6f516e94ae546c695bad0071c@embeddededge.com>
On Sep 16, 2005, at 12:34 PM, Dan Malek wrote:
>
> On Sep 16, 2005, at 12:41 PM, Kumar Gala wrote:
>
>
>> Anyone have any ideas why the bseip_defconfig doesnt build. I get
>> the
>> following error:
>>
>
> I'll look into it.
>
>
>> CC arch/ppc/8xx_io/enet.o
>>
>
> I thought we are should be using the drivers/net/* version of this?
I think that is the longer term plan. I believe at this point we are
still using 8xx_io/enet.c. Not sure how this broken and it might be
a simple defconfig update that is required.
thanks for looking into it.
- kumar
^ permalink raw reply
* Re: [PATCH] powerpc: merge include/asm/cputable.h
From: Kumar Gala @ 2005-09-16 21:40 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linuxppc-dev, pantelis.antoniou, linuxppc64-dev,
linuxppc-embedded
In-Reply-To: <200509160511.39277.arnd@arndb.de>
Ok, I've given into the enum as I dont see anything better.
However, I do have some questions, why introduce new Kconfig options
for ppc64. It seems overkill to have specific build options for each
"class" of ppc64. One could make the argument we should go do the
same thing for classic ppc32. From an embedded point of view I could
reduce down to the specific cpu I'm using. I really dont think we
want to start doing this.
If we did I would have to say we would have to add Kconfig for 601,
603, 604, 750 (740, 750, 755), 7400 (7400/7410), 7450 (744x/745x).
That's six more Kconfig options
I'm ok with the patch, but think we should drop the arch/ppc64/
Kconfig portion and its related effects.
Also, I've changed CPU_FTR to CPU_FTRS for the "left hand side" of
the enum.
- kumar
On Sep 15, 2005, at 10:11 PM, Arnd Bergmann wrote:
> On Freedag 16 September 2005 04:22, Kumar Gala wrote:
>
>
>>> #define CPU_FTR_POSSIBLE CPU_FTR_PSERIES_POSSIBLE |
>>> CPU_FTR_PMAC_POSSIBLE \
>>> | CPU_FTR_...
>>> #define CPU_FTR_ALWAYS CPU_FTR_POSSIBLE & CPU_FTR_PSERIES_ALWAYS \
>>> & CPU_FTR_PMAC_ALWAYS & CPU_FTR_ ...
>>>
>>
>> Yes, something like that. Why do we need the CPU_FTR_ALWAYS. It
>> seems that CPU_FTR_POSSIBLE is sufficient. I may just not understand
>> the purpose of CPU_FTR_ALWAYS.
>>
>>
>>> One point to consider is that we traditionally use #ifdef in the
>>> source for many places that could simply use cpu_has_feature(). E.g.
>>> most instances of #ifdef CONFIG_ALTIVEC could be replaced by
>>> cpu_has_feature(CPU_FTR_ALTIVEC) without additional run-time
>>> overhead.
>>>
>>
>> These should stay as CONFIG options because to reduce the code size
>> of the kernel which is important to embedded people.
>>
>
> The whole point of the logic is to reduce code size, because gcc
> is smart enough to remove all dead code then.
> Consider again the definition of
>
> | static inline int have_feature(unsigned long feature)
> | {
> | return (FEATURE_ALWAYS & feature) ||
> | (FEATURE_POSSIBLE & runtime_feature & feature);
> | }
>
> If the feature is part of FEATURE_ALWAYS, this will be optimized to
>
> | return 1 || FEATURE_POSSIBLE & runtime_feature & feature;
>
> and subsequently
>
> | return 1;
>
> If it is not part of FEATURE_POSSIBLE, it it equivalent to
>
> | return 0 || (0 & runtime_feature & feature);
>
> which becomes
>
> | return 0;
>
>
> Any code inside of
>
> | if (0) { /* ... */ }
>
> is only checked for syntax by gcc but will not end up in the object
> code.
> For the 'if(1)' case, the code gets smaller as well, because the
> runtime
> flag does not have to be dereferenced.
>
> For some places, we might prefer to replace '#ifdef CONFIG_FOO' not
> with
> have_feature(FOO), but rather with feature_possible(FOO), given a
> definition
> of
>
> static inline int have_feature(unsigned int feature)
> {
> return !!(FEATURE_POSSIBLE & feature);
> }
>
> which always get evaluated at compile time.
>
> Arnd <><
>
^ permalink raw reply
* squashfs on ppc
From: Tolunay Orkun @ 2005-09-16 21:48 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
Has anyone any positive or negative experience of using squashfs on
PowerPC as initrd?
Our environment is PowerPC 405GP running 2.4.31 kernel. U-Boot is our
bootloader. Any comparison with respect to CramFS?
Best regards,
Tolunay
^ permalink raw reply
* Re: squashfs on ppc
From: Eugene Surovegin @ 2005-09-16 22:41 UTC (permalink / raw)
To: Tolunay Orkun; +Cc: linuxppc-embedded
In-Reply-To: <432B3D99.5030209@orkun.us>
On Fri, Sep 16, 2005 at 04:48:09PM -0500, Tolunay Orkun wrote:
> Has anyone any positive or negative experience of using squashfs on
> PowerPC as initrd?
>
> Our environment is PowerPC 405GP running 2.4.31 kernel. U-Boot is our
> bootloader. Any comparison with respect to CramFS?
I use squashfs and squashfs2. Both work just fine on PPC.
They provide significantly better compression ration than cramfs,
although at the expense of some speed (mostly visible during initial
startup of big user-space app).
--
Eugene
^ permalink raw reply
* Re: [PATCH] powerpc: merge include/asm/cputable.h
From: Arnd Bergmann @ 2005-09-17 0:36 UTC (permalink / raw)
To: Kumar Gala
Cc: linuxppc-dev, pantelis.antoniou, linuxppc64-dev,
linuxppc-embedded
In-Reply-To: <17FA692D-4643-4390-AE8A-AEF6F716C5EE@freescale.com>
On Freedag 16 September 2005 23:40, Kumar Gala wrote:
> However, I do have some questions, why introduce new Kconfig options
> for ppc64. It seems overkill to have specific build options for each
> "class" of ppc64. One could make the argument we should go do the
> same thing for classic ppc32. From an embedded point of view I could
> reduce down to the specific cpu I'm using. I really dont think we
> want to start doing this.
Note that the configuration options that my patch introduced are
all autodetected from the existing platform CONFIG_PPC_ symbols, so
they don't give you extra settings that might be messed up.
Having the options makes the enum in cpufeatures.h more readable
imho, but if you want to do a patch without them, I wont complain.
> If we did I would have to say we would have to add Kconfig for 601,
> 603, 604, 750 (740, 750, 755), 7400 (7400/7410), 7450 (744x/745x).
> That's six more Kconfig options
I actually like the idea more flexibility to which CPU optimizations
you get in the kernel. These could be combined with the gcc -mcpu=
argument, if there is a way for Kconfig to deduce the most generic
cpu type that still supports all selected models.
The easiest way to do something like this should be to add more
choices to the existing "Processor Type" submenu instead of having
each one selectable separately.
Something tells me that the platform and CPU type selection will
keep us busy for some time, because they are currently treated very
differently in ppc and ppc64. Please tell me if I understand this
correctly:
In ppc, the user can select one out of 27 platforms and one out of
seven separate sets of CPUs. All platforms except CHRP/PowerMac/PReP
can only ever work with a specific CPU selection, while that one
platform has the choice between 6xx/7xx/74xx/52xx/82xx/83xx, POWER3
and POWER4/970. These connections are currently not documented.
In ppc64, the user has to choose between the legacy iSeries and
the generic platform. Generic means any combination of pSeries,
PowerMac, Cell or Maple. The only CPU selection possibility is
'any cpu' or 'Power4 or better'. In future, we will have at least
a third option 'Book E' (or e700), which is incompatible with the
others. With my patch applied, the kernel would automatically disable
support for CPUs that are not possible with the selected platform
setting.
Arnd <><
^ permalink raw reply
* Repeated corruption of file->f_ep_lock
From: David Woodhouse @ 2005-09-17 11:27 UTC (permalink / raw)
To: ppc-dev list; +Cc: Davide Libenzi, viro
For a while I've been seeing occasional deadlocks on one CPU of a PPC
SMP machine:
_spin_lock(c8cbf250) CPU#1 NIP c02bb740 holder: cpu 2305 pc 00000000 (lock 24000484)
Further debugging shows that it's always due to file->f_ep_lock being
corrupted, and the deadlock happens when epoll is used on such a file.
The owner_cpu field is almost always 2305. However, it's not due to the
epoll code itself -- I've turned all three of the epoll syscalls into
sys_ni_syscall and it's still happening. I also added sanity checks for
(file->f_ep_lock.owner_cpu > 1) throughout fs/file_table.c, and I see it
happen ten or twenty times during a kernel compile.
The previous and next members of 'struct file', which are f_ep_list and
f_mapping respectively, are always fine. It's just f_ep_lock which is
scribbled upon, and the scribble is fairly repeatable: 'owner_cpu' is
almost always set to 0x901 but occasionally 0x501, and the 'lock' field
has values like 20282484, 24042884, 28022484, 24042084, 22000424 (hex).
Do those numbers seem meaningful to anyone? Any clues as to where they
might be coming from?
During a kernel compile, the corruption is mostly detected in fget()
from vfs_fstat(), but also I've seen it once or twice in vfs_read() from
do_execve():
File cb2f5b40 (fops d107c980) has corrupted f_epoll_lock!
lock 24002484, owner_pc 0, owner_cpu 901
f->private_data 00000000, f->f_ep_links (cb2f5bc8, cb2f5bc8), f->f_mapping cc21c1c8
f->f_mapping->a_ops d107cad8
Pid 16648, comm gcc
File is /usr/bin/gcc
Badness in dumpbadfile at fs/file_table.c:133
Call trace:
[c00059b8] check_bug_trap+0xa8/0x120
[c0005c94] ProgramCheckException+0x264/0x4e0
[c00050a8] ret_from_except_full+0x0/0x4c
[c0080bb4] dumpbadfile+0x114/0x160
[c007f9f0] vfs_read+0xa0/0x1c0
[c008ef7c] kernel_read+0x3c/0x60
[c0091810] do_execve+0x1e0/0x280
[c0008594] sys_execve+0x64/0xd0
[c0004980] ret_from_syscall+0x0/0x44
This is the Fedora Core kernel (currently 2.6.12.5). The 'owner_cpu > 1'
sanity check isn't applicable to 2.6.13, so I haven't yet tried to
reproduce the problem there.
--
dwmw2
^ permalink raw reply
* Re: Repeated corruption of file->f_ep_lock
From: Paul Mackerras @ 2005-09-17 13:11 UTC (permalink / raw)
To: David Woodhouse; +Cc: ppc-dev list, Davide Libenzi, viro
In-Reply-To: <1126956437.4171.20.camel@baythorne.infradead.org>
David Woodhouse writes:
> The previous and next members of 'struct file', which are f_ep_list and
> f_mapping respectively, are always fine. It's just f_ep_lock which is
> scribbled upon, and the scribble is fairly repeatable: 'owner_cpu' is
> almost always set to 0x901 but occasionally 0x501, and the 'lock' field
> has values like 20282484, 24042884, 28022484, 24042084, 22000424 (hex).
> Do those numbers seem meaningful to anyone? Any clues as to where they
> might be coming from?
They look like part of an exception stack frame. The 901 or 501 would
be the trap number; 500 for an external interrupt or 900 for a
decrementer interrupt, plus 1 which we use as a marker to say that
only the volatile registers have been saved in the frame. The other
values (20282484 etc.) could possibly be condition register values.
That would fit with owner_cpu being 2 words past the lock field; the
trap field in struct pt_regs is 2 words past the ccr field.
Paul.
^ permalink raw reply
* Re: Reminder: removal of APUS and Gemini still pending
From: Simon Richter @ 2005-09-17 14:09 UTC (permalink / raw)
To: Kumar Gala; +Cc: ppc-dev list
In-Reply-To: <15A1D026-00E3-4652-ABA5-9A8B8517A2CA@freescale.com>
Kumar Gala wrote:
> This is a reminder email to all those that care that APUS and Gemini
> configs are still not building in the kernel. They are still scheduled
> to be removed after the release of 2.6.15.
I have a tree that builds an APUS kernel (with Roman Zippel's patches
forwarded to HEAD), however I wanted to hold back with merging it until
the ppc/ppc64 -> powerpc transition is finished; also, I would like to
get proper changesets with attribution instead of a big patch (the plan
is to forward-merge the changes until after the transition, then turn
them back into a diff and apply them step by step).
Simon
^ permalink raw reply
* PATCH powerpc: 00/04 Remove __pmac, etc, sections, merge sections.h
From: Jon Loeliger @ 2005-09-17 15:31 UTC (permalink / raw)
To: linuxppc-dev, linuxppc64-dev
Here is a new patch that removes all notion of the pmac, prep,
chrp and openfirmware initialization sections, and then unifies
the sections.h files without those __pmac, etc, sections identifiers
cluttering things up.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---
Part 01/04 - Remove sections use from ppc
arch/ppc/kernel/pci.c | 10 +-
arch/ppc/kernel/setup.c | 2
arch/ppc/platforms/chrp_pci.c | 8 +-
arch/ppc/platforms/chrp_setup.c | 16 ++-
arch/ppc/platforms/chrp_smp.c | 2
arch/ppc/platforms/chrp_time.c | 8 +-
arch/ppc/platforms/pmac_backlight.c | 16 ++-
arch/ppc/platforms/pmac_cpufreq.c | 36 ++++---
arch/ppc/platforms/pmac_feature.c | 176 ++++++++++++++++++-----------------
arch/ppc/platforms/pmac_nvram.c | 42 ++++----
arch/ppc/platforms/pmac_pci.c | 22 ++--
arch/ppc/platforms/pmac_pic.c | 26 +++--
arch/ppc/platforms/pmac_setup.c | 12 +-
arch/ppc/platforms/pmac_smp.c | 10 +-
arch/ppc/platforms/pmac_time.c | 8 +-
arch/ppc/platforms/prep_pci.c | 64 ++++++-------
arch/ppc/platforms/prep_setup.c | 44 ++++-----
arch/ppc/platforms/residual.c | 2
arch/ppc/syslib/btext.c | 6 +
arch/ppc/syslib/prep_nvram.c | 13 +--
arch/ppc/syslib/prom.c | 18 ++--
Part 02/04 - Remove sections use from ppc64 and drivers
arch/ppc64/kernel/pmac_feature.c | 60 ++++++------
arch/ppc64/kernel/pmac_nvram.c | 30 +++---
arch/ppc64/kernel/pmac_pci.c | 12 +-
arch/ppc64/kernel/pmac_setup.c | 10 +-
arch/ppc64/kernel/pmac_smp.c | 2
arch/ppc64/kernel/pmac_time.c | 4 -
drivers/ide/ppc/pmac.c | 80 ++++++++--------
drivers/macintosh/ans-lcd.c | 10 +-
drivers/macintosh/mediabay.c | 56 ++++++-----
drivers/macintosh/via-cuda.c | 1
drivers/macintosh/via-pmu.c | 129 +++++++++++++-------------
drivers/macintosh/via-pmu68k.c | 15 +--
Part 03/04 - Remove section free() and linker script
arch/ppc/kernel/vmlinux.lds.S | 26 -----
arch/ppc/mm/init.c | 12 --
Part 04/04 - Merge simplified sections.h into asm-powerpc
include/asm-powerpc/sections.h | 20 ++++
include/asm-ppc/sections.h | 33 -------
include/asm-ppc64/sections.h | 29 ------
38 files changed, 492 insertions(+), 578 deletions(-)
^ permalink raw reply
* PATCH powerpc: 01/04 Remove sections use from ppc
From: Jon Loeliger @ 2005-09-17 15:35 UTC (permalink / raw)
To: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -644,7 +644,7 @@ pcibios_alloc_controller(void)
/*
* Functions below are used on OpenFirmware machines.
*/
-static void __openfirmware
+static void
make_one_node_map(struct device_node* node, u8 pci_bus)
{
int *bus_range;
@@ -678,7 +678,7 @@ make_one_node_map(struct device_node* no
}
}
-void __openfirmware
+void
pcibios_make_OF_bus_map(void)
{
int i;
@@ -720,7 +720,7 @@ pcibios_make_OF_bus_map(void)
typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
-static struct device_node* __openfirmware
+static struct device_node*
scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
{
struct device_node* sub_node;
@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct devic
return 0;
}
-static struct device_node* __openfirmware
+static struct device_node*
scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
{
u8 filter_data[2] = {bus, dev_fn};
@@ -842,7 +842,7 @@ pci_find_hose_for_OF_device(struct devic
return NULL;
}
-static int __openfirmware
+static int
find_OF_pci_device_filter(struct device_node* node, void* data)
{
return ((void *)node == data);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -339,7 +339,7 @@ early_init(int r3, int r4, int r5)
* Assume here that all clock rates are the same in a
* smp system. -- Cort
*/
-int __openfirmware
+int
of_show_percpuinfo(struct seq_file *m, int i)
{
struct device_node *cpu_node;
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
--- a/arch/ppc/platforms/chrp_pci.c
+++ b/arch/ppc/platforms/chrp_pci.c
@@ -29,7 +29,7 @@ void __iomem *gg2_pci_config_base;
* limit the bus number to 3 bits
*/
-int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
+int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
int len, u32 *val)
{
volatile void __iomem *cfg_data;
@@ -56,7 +56,7 @@ int __chrp gg2_read_config(struct pci_bu
return PCIBIOS_SUCCESSFUL;
}
-int __chrp gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
+int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
int len, u32 val)
{
volatile void __iomem *cfg_data;
@@ -92,7 +92,7 @@ static struct pci_ops gg2_pci_ops =
/*
* Access functions for PCI config space using RTAS calls.
*/
-int __chrp
+int
rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
{
@@ -108,7 +108,7 @@ rtas_read_config(struct pci_bus *bus, un
return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
}
-int __chrp
+int
rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 val)
{
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
--- a/arch/ppc/platforms/chrp_setup.c
+++ b/arch/ppc/platforms/chrp_setup.c
@@ -105,7 +105,7 @@ static const char *gg2_cachemodes[4] = {
"Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
};
-int __chrp
+int
chrp_show_cpuinfo(struct seq_file *m)
{
int i, sdramen;
@@ -303,7 +303,7 @@ void __init chrp_setup_arch(void)
pci_create_OF_bus_map();
}
-void __chrp
+void
chrp_event_scan(void)
{
unsigned char log[1024];
@@ -314,7 +314,7 @@ chrp_event_scan(void)
ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
}
-void __chrp
+void
chrp_restart(char *cmd)
{
printk("RTAS system-reboot returned %d\n",
@@ -322,7 +322,7 @@ chrp_restart(char *cmd)
for (;;);
}
-void __chrp
+void
chrp_power_off(void)
{
/* allow power on only with power button press */
@@ -331,13 +331,13 @@ chrp_power_off(void)
for (;;);
}
-void __chrp
+void
chrp_halt(void)
{
chrp_power_off();
}
-u_int __chrp
+u_int
chrp_irq_canonicalize(u_int irq)
{
if (irq == 2)
@@ -572,7 +572,7 @@ chrp_init(unsigned long r3, unsigned lon
if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
}
-void __chrp
+void
rtas_display_progress(char *s, unsigned short hex)
{
int width;
@@ -599,7 +599,7 @@ rtas_display_progress(char *s, unsigned
call_rtas( "display-character", 1, 1, NULL, ' ' );
}
-void __chrp
+void
rtas_indicator_progress(char *s, unsigned short hex)
{
call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
--- a/arch/ppc/platforms/chrp_smp.c
+++ b/arch/ppc/platforms/chrp_smp.c
@@ -88,7 +88,7 @@ smp_chrp_take_timebase(void)
}
/* CHRP with openpic */
-struct smp_ops_t chrp_smp_ops __chrpdata = {
+struct smp_ops_t chrp_smp_ops = {
.message_pass = smp_openpic_message_pass,
.probe = smp_chrp_probe,
.kick_cpu = smp_chrp_kick_cpu,
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c
--- a/arch/ppc/platforms/chrp_time.c
+++ b/arch/ppc/platforms/chrp_time.c
@@ -52,7 +52,7 @@ long __init chrp_time_init(void)
return 0;
}
-int __chrp chrp_cmos_clock_read(int addr)
+int chrp_cmos_clock_read(int addr)
{
if (nvram_as1 != 0)
outb(addr>>8, nvram_as1);
@@ -60,7 +60,7 @@ int __chrp chrp_cmos_clock_read(int addr
return (inb(nvram_data));
}
-void __chrp chrp_cmos_clock_write(unsigned long val, int addr)
+void chrp_cmos_clock_write(unsigned long val, int addr)
{
if (nvram_as1 != 0)
outb(addr>>8, nvram_as1);
@@ -72,7 +72,7 @@ void __chrp chrp_cmos_clock_write(unsign
/*
* Set the hardware clock. -- Cort
*/
-int __chrp chrp_set_rtc_time(unsigned long nowtime)
+int chrp_set_rtc_time(unsigned long nowtime)
{
unsigned char save_control, save_freq_select;
struct rtc_time tm;
@@ -118,7 +118,7 @@ int __chrp chrp_set_rtc_time(unsigned lo
return 0;
}
-unsigned long __chrp chrp_get_rtc_time(void)
+unsigned long chrp_get_rtc_time(void)
{
unsigned int year, mon, day, hour, min, sec;
int uip, i;
diff --git a/arch/ppc/platforms/pmac_backlight.c b/arch/ppc/platforms/pmac_backlight.c
--- a/arch/ppc/platforms/pmac_backlight.c
+++ b/arch/ppc/platforms/pmac_backlight.c
@@ -37,7 +37,7 @@ static int backlight_req_enable = -1;
static void backlight_callback(void *);
static DECLARE_WORK(backlight_work, backlight_callback, NULL);
-void __pmac register_backlight_controller(struct backlight_controller *ctrler,
+void register_backlight_controller(struct backlight_controller *ctrler,
void *data, char *type)
{
struct device_node* bk_node;
@@ -99,7 +99,7 @@ void __pmac register_backlight_controlle
}
EXPORT_SYMBOL(register_backlight_controller);
-void __pmac unregister_backlight_controller(struct backlight_controller
+void unregister_backlight_controller(struct backlight_controller
*ctrler, void *data)
{
/* We keep the current backlight level (for now) */
@@ -108,7 +108,7 @@ void __pmac unregister_backlight_control
}
EXPORT_SYMBOL(unregister_backlight_controller);
-static int __pmac __set_backlight_enable(int enable)
+static int __set_backlight_enable(int enable)
{
int rc;
@@ -122,7 +122,7 @@ static int __pmac __set_backlight_enable
release_console_sem();
return rc;
}
-int __pmac set_backlight_enable(int enable)
+int set_backlight_enable(int enable)
{
if (!backlighter)
return -ENODEV;
@@ -133,7 +133,7 @@ int __pmac set_backlight_enable(int enab
EXPORT_SYMBOL(set_backlight_enable);
-int __pmac get_backlight_enable(void)
+int get_backlight_enable(void)
{
if (!backlighter)
return -ENODEV;
@@ -141,7 +141,7 @@ int __pmac get_backlight_enable(void)
}
EXPORT_SYMBOL(get_backlight_enable);
-static int __pmac __set_backlight_level(int level)
+static int __set_backlight_level(int level)
{
int rc = 0;
@@ -165,7 +165,7 @@ static int __pmac __set_backlight_level(
}
return rc;
}
-int __pmac set_backlight_level(int level)
+int set_backlight_level(int level)
{
if (!backlighter)
return -ENODEV;
@@ -176,7 +176,7 @@ int __pmac set_backlight_level(int level
EXPORT_SYMBOL(set_backlight_level);
-int __pmac get_backlight_level(void)
+int get_backlight_level(void)
{
if (!backlighter)
return -ENODEV;
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -136,7 +136,7 @@ static inline void debug_calc_bogomips(v
/* Switch CPU speed under 750FX CPU control
*/
-static int __pmac cpu_750fx_cpu_speed(int low_speed)
+static int cpu_750fx_cpu_speed(int low_speed)
{
u32 hid2;
@@ -172,7 +172,7 @@ static int __pmac cpu_750fx_cpu_speed(in
return 0;
}
-static unsigned int __pmac cpu_750fx_get_cpu_speed(void)
+static unsigned int cpu_750fx_get_cpu_speed(void)
{
if (mfspr(SPRN_HID1) & HID1_PS)
return low_freq;
@@ -181,7 +181,7 @@ static unsigned int __pmac cpu_750fx_get
}
/* Switch CPU speed using DFS */
-static int __pmac dfs_set_cpu_speed(int low_speed)
+static int dfs_set_cpu_speed(int low_speed)
{
if (low_speed == 0) {
/* ramping up, set voltage first */
@@ -205,7 +205,7 @@ static int __pmac dfs_set_cpu_speed(int
return 0;
}
-static unsigned int __pmac dfs_get_cpu_speed(void)
+static unsigned int dfs_get_cpu_speed(void)
{
if (mfspr(SPRN_HID1) & HID1_DFS)
return low_freq;
@@ -216,7 +216,7 @@ static unsigned int __pmac dfs_get_cpu_s
/* Switch CPU speed using slewing GPIOs
*/
-static int __pmac gpios_set_cpu_speed(int low_speed)
+static int gpios_set_cpu_speed(int low_speed)
{
int gpio, timeout = 0;
@@ -258,7 +258,7 @@ static int __pmac gpios_set_cpu_speed(in
/* Switch CPU speed under PMU control
*/
-static int __pmac pmu_set_cpu_speed(int low_speed)
+static int pmu_set_cpu_speed(int low_speed)
{
struct adb_request req;
unsigned long save_l2cr;
@@ -354,7 +354,7 @@ static int __pmac pmu_set_cpu_speed(int
return 0;
}
-static int __pmac do_set_cpu_speed(int speed_mode, int notify)
+static int do_set_cpu_speed(int speed_mode, int notify)
{
struct cpufreq_freqs freqs;
unsigned long l3cr;
@@ -391,17 +391,17 @@ static int __pmac do_set_cpu_speed(int s
return 0;
}
-static unsigned int __pmac pmac_cpufreq_get_speed(unsigned int cpu)
+static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
{
return cur_freq;
}
-static int __pmac pmac_cpufreq_verify(struct cpufreq_policy *policy)
+static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
{
return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
}
-static int __pmac pmac_cpufreq_target( struct cpufreq_policy *policy,
+static int pmac_cpufreq_target( struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
@@ -414,13 +414,13 @@ static int __pmac pmac_cpufreq_target( s
return do_set_cpu_speed(newstate, 1);
}
-unsigned int __pmac pmac_get_one_cpufreq(int i)
+unsigned int pmac_get_one_cpufreq(int i)
{
/* Supports only one CPU for now */
return (i == 0) ? cur_freq : 0;
}
-static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
if (policy->cpu != 0)
return -ENODEV;
@@ -433,7 +433,7 @@ static int __pmac pmac_cpufreq_cpu_init(
return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
}
-static u32 __pmac read_gpio(struct device_node *np)
+static u32 read_gpio(struct device_node *np)
{
u32 *reg = (u32 *)get_property(np, "reg", NULL);
u32 offset;
@@ -452,7 +452,7 @@ static u32 __pmac read_gpio(struct devic
return offset;
}
-static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
+static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
{
/* Ok, this could be made a bit smarter, but let's be robust for now. We
* always force a speed change to high speed before sleep, to make sure
@@ -468,7 +468,7 @@ static int __pmac pmac_cpufreq_suspend(s
return 0;
}
-static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy)
+static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
{
/* If we resume, first check if we have a get() function */
if (get_speed_proc)
@@ -501,7 +501,7 @@ static struct cpufreq_driver pmac_cpufre
};
-static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
+static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
{
struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
"voltage-gpio");
@@ -593,7 +593,7 @@ static int __pmac pmac_cpufreq_init_MacR
return 0;
}
-static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
+static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
{
struct device_node *volt_gpio_np;
@@ -620,7 +620,7 @@ static int __pmac pmac_cpufreq_init_7447
return 0;
}
-static int __pmac pmac_cpufreq_init_750FX(struct device_node *cpunode)
+static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
{
struct device_node *volt_gpio_np;
u32 pvr, *value;
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -63,7 +63,7 @@ extern struct device_node *k2_skiplist[2
* We use a single global lock to protect accesses. Each driver has
* to take care of its own locking
*/
-static DEFINE_SPINLOCK(feature_lock __pmacdata);
+static DEFINE_SPINLOCK(feature_lock);
#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
@@ -72,9 +72,9 @@ static DEFINE_SPINLOCK(feature_lock __p
/*
* Instance of some macio stuffs
*/
-struct macio_chip macio_chips[MAX_MACIO_CHIPS] __pmacdata;
+struct macio_chip macio_chips[MAX_MACIO_CHIPS];
-struct macio_chip* __pmac macio_find(struct device_node* child, int type)
+struct macio_chip* macio_find(struct device_node* child, int type)
{
while(child) {
int i;
@@ -89,7 +89,7 @@ struct macio_chip* __pmac macio_find(str
}
EXPORT_SYMBOL_GPL(macio_find);
-static const char* macio_names[] __pmacdata =
+static const char* macio_names[] =
{
"Unknown",
"Grand Central",
@@ -116,10 +116,10 @@ static const char* macio_names[] __pmacd
#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
-static struct device_node* uninorth_node __pmacdata;
-static u32 __iomem * uninorth_base __pmacdata;
-static u32 uninorth_rev __pmacdata;
-static int uninorth_u3 __pmacdata;
+static struct device_node* uninorth_node;
+static u32 __iomem * uninorth_base;
+static u32 uninorth_rev;
+static int uninorth_u3;
static void __iomem *u3_ht;
/*
@@ -142,13 +142,13 @@ struct pmac_mb_def
struct feature_table_entry* features;
unsigned long board_flags;
};
-static struct pmac_mb_def pmac_mb __pmacdata;
+static struct pmac_mb_def pmac_mb;
/*
* Here are the chip specific feature functions
*/
-static inline int __pmac
+static inline int
simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value)
{
struct macio_chip* macio;
@@ -170,7 +170,7 @@ simple_feature_tweak(struct device_node*
#ifndef CONFIG_POWER4
-static long __pmac
+static long
ohare_htw_scc_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -263,21 +263,21 @@ ohare_htw_scc_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
ohare_floppy_enable(struct device_node* node, long param, long value)
{
return simple_feature_tweak(node, macio_ohare,
OHARE_FCR, OH_FLOPPY_ENABLE, value);
}
-static long __pmac
+static long
ohare_mesh_enable(struct device_node* node, long param, long value)
{
return simple_feature_tweak(node, macio_ohare,
OHARE_FCR, OH_MESH_ENABLE, value);
}
-static long __pmac
+static long
ohare_ide_enable(struct device_node* node, long param, long value)
{
switch(param) {
@@ -298,7 +298,7 @@ ohare_ide_enable(struct device_node* nod
}
}
-static long __pmac
+static long
ohare_ide_reset(struct device_node* node, long param, long value)
{
switch(param) {
@@ -313,7 +313,7 @@ ohare_ide_reset(struct device_node* node
}
}
-static long __pmac
+static long
ohare_sleep_state(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -329,7 +329,7 @@ ohare_sleep_state(struct device_node* no
return 0;
}
-static long __pmac
+static long
heathrow_modem_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -373,7 +373,7 @@ heathrow_modem_enable(struct device_node
return 0;
}
-static long __pmac
+static long
heathrow_floppy_enable(struct device_node* node, long param, long value)
{
return simple_feature_tweak(node, macio_unknown,
@@ -382,7 +382,7 @@ heathrow_floppy_enable(struct device_nod
value);
}
-static long __pmac
+static long
heathrow_mesh_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -411,7 +411,7 @@ heathrow_mesh_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
heathrow_ide_enable(struct device_node* node, long param, long value)
{
switch(param) {
@@ -426,7 +426,7 @@ heathrow_ide_enable(struct device_node*
}
}
-static long __pmac
+static long
heathrow_ide_reset(struct device_node* node, long param, long value)
{
switch(param) {
@@ -441,7 +441,7 @@ heathrow_ide_reset(struct device_node* n
}
}
-static long __pmac
+static long
heathrow_bmac_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -470,7 +470,7 @@ heathrow_bmac_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
heathrow_sound_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -501,16 +501,16 @@ heathrow_sound_enable(struct device_node
return 0;
}
-static u32 save_fcr[6] __pmacdata;
-static u32 save_mbcr __pmacdata;
-static u32 save_gpio_levels[2] __pmacdata;
-static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT] __pmacdata;
-static u8 save_gpio_normal[KEYLARGO_GPIO_CNT] __pmacdata;
-static u32 save_unin_clock_ctl __pmacdata;
-static struct dbdma_regs save_dbdma[13] __pmacdata;
-static struct dbdma_regs save_alt_dbdma[13] __pmacdata;
+static u32 save_fcr[6];
+static u32 save_mbcr;
+static u32 save_gpio_levels[2];
+static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
+static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
+static u32 save_unin_clock_ctl;
+static struct dbdma_regs save_dbdma[13];
+static struct dbdma_regs save_alt_dbdma[13];
-static void __pmac
+static void
dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
{
int i;
@@ -527,7 +527,7 @@ dbdma_save(struct macio_chip* macio, str
}
}
-static void __pmac
+static void
dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
{
int i;
@@ -547,7 +547,7 @@ dbdma_restore(struct macio_chip* macio,
}
}
-static void __pmac
+static void
heathrow_sleep(struct macio_chip* macio, int secondary)
{
if (secondary) {
@@ -580,7 +580,7 @@ heathrow_sleep(struct macio_chip* macio,
(void)MACIO_IN32(HEATHROW_FCR);
}
-static void __pmac
+static void
heathrow_wakeup(struct macio_chip* macio, int secondary)
{
if (secondary) {
@@ -605,7 +605,7 @@ heathrow_wakeup(struct macio_chip* macio
}
}
-static long __pmac
+static long
heathrow_sleep_state(struct device_node* node, long param, long value)
{
if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
@@ -622,7 +622,7 @@ heathrow_sleep_state(struct device_node*
return 0;
}
-static long __pmac
+static long
core99_scc_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -723,7 +723,7 @@ core99_scc_enable(struct device_node* no
return 0;
}
-static long __pmac
+static long
core99_modem_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -775,7 +775,7 @@ core99_modem_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
pangea_modem_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -830,7 +830,7 @@ pangea_modem_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
core99_ata100_enable(struct device_node* node, long value)
{
unsigned long flags;
@@ -860,7 +860,7 @@ core99_ata100_enable(struct device_node*
return 0;
}
-static long __pmac
+static long
core99_ide_enable(struct device_node* node, long param, long value)
{
/* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
@@ -883,7 +883,7 @@ core99_ide_enable(struct device_node* no
}
}
-static long __pmac
+static long
core99_ide_reset(struct device_node* node, long param, long value)
{
switch(param) {
@@ -901,7 +901,7 @@ core99_ide_reset(struct device_node* nod
}
}
-static long __pmac
+static long
core99_gmac_enable(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -918,7 +918,7 @@ core99_gmac_enable(struct device_node* n
return 0;
}
-static long __pmac
+static long
core99_gmac_phy_reset(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -943,7 +943,7 @@ core99_gmac_phy_reset(struct device_node
return 0;
}
-static long __pmac
+static long
core99_sound_chip_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -973,7 +973,7 @@ core99_sound_chip_enable(struct device_n
return 0;
}
-static long __pmac
+static long
core99_airport_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -1060,7 +1060,7 @@ core99_airport_enable(struct device_node
}
#ifdef CONFIG_SMP
-static long __pmac
+static long
core99_reset_cpu(struct device_node* node, long param, long value)
{
unsigned int reset_io = 0;
@@ -1104,7 +1104,7 @@ core99_reset_cpu(struct device_node* nod
}
#endif /* CONFIG_SMP */
-static long __pmac
+static long
core99_usb_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio;
@@ -1257,7 +1257,7 @@ core99_usb_enable(struct device_node* no
return 0;
}
-static long __pmac
+static long
core99_firewire_enable(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -1284,7 +1284,7 @@ core99_firewire_enable(struct device_nod
return 0;
}
-static long __pmac
+static long
core99_firewire_cable_power(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -1315,7 +1315,7 @@ core99_firewire_cable_power(struct devic
return 0;
}
-static long __pmac
+static long
intrepid_aack_delay_enable(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -1336,7 +1336,7 @@ intrepid_aack_delay_enable(struct device
#endif /* CONFIG_POWER4 */
-static long __pmac
+static long
core99_read_gpio(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -1345,7 +1345,7 @@ core99_read_gpio(struct device_node* nod
}
-static long __pmac
+static long
core99_write_gpio(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -1356,7 +1356,7 @@ core99_write_gpio(struct device_node* no
#ifdef CONFIG_POWER4
-static long __pmac
+static long
g5_gmac_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -1380,7 +1380,7 @@ g5_gmac_enable(struct device_node* node,
return 0;
}
-static long __pmac
+static long
g5_fw_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -1403,7 +1403,7 @@ g5_fw_enable(struct device_node* node, l
return 0;
}
-static long __pmac
+static long
g5_mpic_enable(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -1419,7 +1419,7 @@ g5_mpic_enable(struct device_node* node,
}
#ifdef CONFIG_SMP
-static long __pmac
+static long
g5_reset_cpu(struct device_node* node, long param, long value)
{
unsigned int reset_io = 0;
@@ -1465,7 +1465,7 @@ g5_reset_cpu(struct device_node* node, l
* This takes the second CPU off the bus on dual CPU machines
* running UP
*/
-void __pmac g5_phy_disable_cpu1(void)
+void g5_phy_disable_cpu1(void)
{
UN_OUT(U3_API_PHY_CONFIG_1, 0);
}
@@ -1474,7 +1474,7 @@ void __pmac g5_phy_disable_cpu1(void)
#ifndef CONFIG_POWER4
-static void __pmac
+static void
keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
{
u32 temp;
@@ -1528,7 +1528,7 @@ keylargo_shutdown(struct macio_chip* mac
(void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
}
-static void __pmac
+static void
pangea_shutdown(struct macio_chip* macio, int sleep_mode)
{
u32 temp;
@@ -1562,7 +1562,7 @@ pangea_shutdown(struct macio_chip* macio
(void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
}
-static void __pmac
+static void
intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
{
u32 temp;
@@ -1591,7 +1591,7 @@ intrepid_shutdown(struct macio_chip* mac
}
-void __pmac pmac_tweak_clock_spreading(int enable)
+void pmac_tweak_clock_spreading(int enable)
{
struct macio_chip* macio = &macio_chips[0];
@@ -1698,7 +1698,7 @@ void __pmac pmac_tweak_clock_spreading(i
}
-static int __pmac
+static int
core99_sleep(void)
{
struct macio_chip* macio;
@@ -1791,7 +1791,7 @@ core99_sleep(void)
return 0;
}
-static int __pmac
+static int
core99_wake_up(void)
{
struct macio_chip* macio;
@@ -1854,7 +1854,7 @@ core99_wake_up(void)
return 0;
}
-static long __pmac
+static long
core99_sleep_state(struct device_node* node, long param, long value)
{
/* Param == 1 means to enter the "fake sleep" mode that is
@@ -1884,7 +1884,7 @@ core99_sleep_state(struct device_node* n
#endif /* CONFIG_POWER4 */
-static long __pmac
+static long
generic_dev_can_wake(struct device_node* node, long param, long value)
{
/* Todo: eventually check we are really dealing with on-board
@@ -1896,7 +1896,7 @@ generic_dev_can_wake(struct device_node*
return 0;
}
-static long __pmac
+static long
generic_get_mb_info(struct device_node* node, long param, long value)
{
switch(param) {
@@ -1919,7 +1919,7 @@ generic_get_mb_info(struct device_node*
/* Used on any machine
*/
-static struct feature_table_entry any_features[] __pmacdata = {
+static struct feature_table_entry any_features[] = {
{ PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
{ PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake },
{ 0, NULL }
@@ -1931,7 +1931,7 @@ static struct feature_table_entry any_fe
* 2400,3400 and 3500 series powerbooks. Some older desktops seem
* to have issues with turning on/off those asic cells
*/
-static struct feature_table_entry ohare_features[] __pmacdata = {
+static struct feature_table_entry ohare_features[] = {
{ PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
{ PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable },
{ PMAC_FTR_MESH_ENABLE, ohare_mesh_enable },
@@ -1945,7 +1945,7 @@ static struct feature_table_entry ohare_
* Separated as some features couldn't be properly tested
* and the serial port control bits appear to confuse it.
*/
-static struct feature_table_entry heathrow_desktop_features[] __pmacdata = {
+static struct feature_table_entry heathrow_desktop_features[] = {
{ PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
{ PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
{ PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
@@ -1957,7 +1957,7 @@ static struct feature_table_entry heathr
/* Heathrow based laptop, that is the Wallstreet and mainstreet
* powerbooks.
*/
-static struct feature_table_entry heathrow_laptop_features[] __pmacdata = {
+static struct feature_table_entry heathrow_laptop_features[] = {
{ PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
{ PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
{ PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
@@ -1973,7 +1973,7 @@ static struct feature_table_entry heathr
/* Paddington based machines
* The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
*/
-static struct feature_table_entry paddington_features[] __pmacdata = {
+static struct feature_table_entry paddington_features[] = {
{ PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
{ PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
{ PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
@@ -1991,7 +1991,7 @@ static struct feature_table_entry paddin
* chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
* used on iBook2 & iMac "flow power".
*/
-static struct feature_table_entry core99_features[] __pmacdata = {
+static struct feature_table_entry core99_features[] = {
{ PMAC_FTR_SCC_ENABLE, core99_scc_enable },
{ PMAC_FTR_MODEM_ENABLE, core99_modem_enable },
{ PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2014,7 +2014,7 @@ static struct feature_table_entry core99
/* RackMac
*/
-static struct feature_table_entry rackmac_features[] __pmacdata = {
+static struct feature_table_entry rackmac_features[] = {
{ PMAC_FTR_SCC_ENABLE, core99_scc_enable },
{ PMAC_FTR_IDE_ENABLE, core99_ide_enable },
{ PMAC_FTR_IDE_RESET, core99_ide_reset },
@@ -2034,7 +2034,7 @@ static struct feature_table_entry rackma
/* Pangea features
*/
-static struct feature_table_entry pangea_features[] __pmacdata = {
+static struct feature_table_entry pangea_features[] = {
{ PMAC_FTR_SCC_ENABLE, core99_scc_enable },
{ PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
{ PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2054,7 +2054,7 @@ static struct feature_table_entry pangea
/* Intrepid features
*/
-static struct feature_table_entry intrepid_features[] __pmacdata = {
+static struct feature_table_entry intrepid_features[] = {
{ PMAC_FTR_SCC_ENABLE, core99_scc_enable },
{ PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
{ PMAC_FTR_IDE_ENABLE, core99_ide_enable },
@@ -2077,7 +2077,7 @@ static struct feature_table_entry intrep
/* G5 features
*/
-static struct feature_table_entry g5_features[] __pmacdata = {
+static struct feature_table_entry g5_features[] = {
{ PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
{ PMAC_FTR_1394_ENABLE, g5_fw_enable },
{ PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
@@ -2091,7 +2091,7 @@ static struct feature_table_entry g5_fea
#endif /* CONFIG_POWER4 */
-static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
+static struct pmac_mb_def pmac_mb_defs[] = {
#ifndef CONFIG_POWER4
/*
* Desktops
@@ -2352,7 +2352,7 @@ static struct pmac_mb_def pmac_mb_defs[]
/*
* The toplevel feature_call callback
*/
-long __pmac
+long
pmac_do_feature_call(unsigned int selector, ...)
{
struct device_node* node;
@@ -2935,8 +2935,8 @@ void __init pmac_check_ht_link(void)
* Early video resume hook
*/
-static void (*pmac_early_vresume_proc)(void *data) __pmacdata;
-static void *pmac_early_vresume_data __pmacdata;
+static void (*pmac_early_vresume_proc)(void *data);
+static void *pmac_early_vresume_data;
void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
{
@@ -2949,7 +2949,7 @@ void pmac_set_early_video_resume(void (*
}
EXPORT_SYMBOL(pmac_set_early_video_resume);
-void __pmac pmac_call_early_video_resume(void)
+void pmac_call_early_video_resume(void)
{
if (pmac_early_vresume_proc)
pmac_early_vresume_proc(pmac_early_vresume_data);
@@ -2959,11 +2959,11 @@ void __pmac pmac_call_early_video_resume
* AGP related suspend/resume code
*/
-static struct pci_dev *pmac_agp_bridge __pmacdata;
-static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata;
-static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata;
+static struct pci_dev *pmac_agp_bridge;
+static int (*pmac_agp_suspend)(struct pci_dev *bridge);
+static int (*pmac_agp_resume)(struct pci_dev *bridge);
-void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
+void pmac_register_agp_pm(struct pci_dev *bridge,
int (*suspend)(struct pci_dev *bridge),
int (*resume)(struct pci_dev *bridge))
{
@@ -2980,7 +2980,7 @@ void __pmac pmac_register_agp_pm(struct
}
EXPORT_SYMBOL(pmac_register_agp_pm);
-void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
+void pmac_suspend_agp_for_card(struct pci_dev *dev)
{
if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
return;
@@ -2990,7 +2990,7 @@ void __pmac pmac_suspend_agp_for_card(st
}
EXPORT_SYMBOL(pmac_suspend_agp_for_card);
-void __pmac pmac_resume_agp_for_card(struct pci_dev *dev)
+void pmac_resume_agp_for_card(struct pci_dev *dev)
{
if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
return;
diff --git a/arch/ppc/platforms/pmac_nvram.c b/arch/ppc/platforms/pmac_nvram.c
--- a/arch/ppc/platforms/pmac_nvram.c
+++ b/arch/ppc/platforms/pmac_nvram.c
@@ -88,17 +88,17 @@ extern int system_running;
static int (*core99_write_bank)(int bank, u8* datas);
static int (*core99_erase_bank)(int bank);
-static char *nvram_image __pmacdata;
+static char *nvram_image;
-static unsigned char __pmac core99_nvram_read_byte(int addr)
+static unsigned char core99_nvram_read_byte(int addr)
{
if (nvram_image == NULL)
return 0xff;
return nvram_image[addr];
}
-static void __pmac core99_nvram_write_byte(int addr, unsigned char val)
+static void core99_nvram_write_byte(int addr, unsigned char val)
{
if (nvram_image == NULL)
return;
@@ -106,18 +106,18 @@ static void __pmac core99_nvram_write_by
}
-static unsigned char __openfirmware direct_nvram_read_byte(int addr)
+static unsigned char direct_nvram_read_byte(int addr)
{
return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
}
-static void __openfirmware direct_nvram_write_byte(int addr, unsigned char val)
+static void direct_nvram_write_byte(int addr, unsigned char val)
{
out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val);
}
-static unsigned char __pmac indirect_nvram_read_byte(int addr)
+static unsigned char indirect_nvram_read_byte(int addr)
{
unsigned char val;
unsigned long flags;
@@ -130,7 +130,7 @@ static unsigned char __pmac indirect_nvr
return val;
}
-static void __pmac indirect_nvram_write_byte(int addr, unsigned char val)
+static void indirect_nvram_write_byte(int addr, unsigned char val)
{
unsigned long flags;
@@ -143,13 +143,13 @@ static void __pmac indirect_nvram_write_
#ifdef CONFIG_ADB_PMU
-static void __pmac pmu_nvram_complete(struct adb_request *req)
+static void pmu_nvram_complete(struct adb_request *req)
{
if (req->arg)
complete((struct completion *)req->arg);
}
-static unsigned char __pmac pmu_nvram_read_byte(int addr)
+static unsigned char pmu_nvram_read_byte(int addr)
{
struct adb_request req;
DECLARE_COMPLETION(req_complete);
@@ -165,7 +165,7 @@ static unsigned char __pmac pmu_nvram_re
return req.reply[0];
}
-static void __pmac pmu_nvram_write_byte(int addr, unsigned char val)
+static void pmu_nvram_write_byte(int addr, unsigned char val)
{
struct adb_request req;
DECLARE_COMPLETION(req_complete);
@@ -183,7 +183,7 @@ static void __pmac pmu_nvram_write_byte(
#endif /* CONFIG_ADB_PMU */
-static u8 __pmac chrp_checksum(struct chrp_header* hdr)
+static u8 chrp_checksum(struct chrp_header* hdr)
{
u8 *ptr;
u16 sum = hdr->signature;
@@ -194,7 +194,7 @@ static u8 __pmac chrp_checksum(struct ch
return sum;
}
-static u32 __pmac core99_calc_adler(u8 *buffer)
+static u32 core99_calc_adler(u8 *buffer)
{
int cnt;
u32 low, high;
@@ -216,7 +216,7 @@ static u32 __pmac core99_calc_adler(u8 *
return (high << 16) | low;
}
-static u32 __pmac core99_check(u8* datas)
+static u32 core99_check(u8* datas)
{
struct core99_header* hdr99 = (struct core99_header*)datas;
@@ -235,7 +235,7 @@ static u32 __pmac core99_check(u8* datas
return hdr99->generation;
}
-static int __pmac sm_erase_bank(int bank)
+static int sm_erase_bank(int bank)
{
int stat, i;
unsigned long timeout;
@@ -267,7 +267,7 @@ static int __pmac sm_erase_bank(int bank
return 0;
}
-static int __pmac sm_write_bank(int bank, u8* datas)
+static int sm_write_bank(int bank, u8* datas)
{
int i, stat = 0;
unsigned long timeout;
@@ -302,7 +302,7 @@ static int __pmac sm_write_bank(int bank
return 0;
}
-static int __pmac amd_erase_bank(int bank)
+static int amd_erase_bank(int bank)
{
int i, stat = 0;
unsigned long timeout;
@@ -349,7 +349,7 @@ static int __pmac amd_erase_bank(int ban
return 0;
}
-static int __pmac amd_write_bank(int bank, u8* datas)
+static int amd_write_bank(int bank, u8* datas)
{
int i, stat = 0;
unsigned long timeout;
@@ -430,7 +430,7 @@ static void __init lookup_partitions(voi
DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
}
-static void __pmac core99_nvram_sync(void)
+static void core99_nvram_sync(void)
{
struct core99_header* hdr99;
unsigned long flags;
@@ -554,12 +554,12 @@ void __init pmac_nvram_init(void)
lookup_partitions();
}
-int __pmac pmac_get_partition(int partition)
+int pmac_get_partition(int partition)
{
return nvram_partitions[partition];
}
-u8 __pmac pmac_xpram_read(int xpaddr)
+u8 pmac_xpram_read(int xpaddr)
{
int offset = nvram_partitions[pmac_nvram_XPRAM];
@@ -569,7 +569,7 @@ u8 __pmac pmac_xpram_read(int xpaddr)
return ppc_md.nvram_read_val(xpaddr + offset);
}
-void __pmac pmac_xpram_write(int xpaddr, u8 data)
+void pmac_xpram_write(int xpaddr, u8 data)
{
int offset = nvram_partitions[pmac_nvram_XPRAM];
diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
--- a/arch/ppc/platforms/pmac_pci.c
+++ b/arch/ppc/platforms/pmac_pci.c
@@ -141,7 +141,7 @@ fixup_bus_range(struct device_node *brid
|(((unsigned long)(off)) & 0xFCUL) \
|1UL)
-static void volatile __iomem * __pmac
+static void volatile __iomem *
macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset)
{
unsigned int caddr;
@@ -162,7 +162,7 @@ macrisc_cfg_access(struct pci_controller
return hose->cfg_data + offset;
}
-static int __pmac
+static int
macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
{
@@ -190,7 +190,7 @@ macrisc_read_config(struct pci_bus *bus,
return PCIBIOS_SUCCESSFUL;
}
-static int __pmac
+static int
macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 val)
{
@@ -230,7 +230,7 @@ static struct pci_ops macrisc_pci_ops =
/*
* Verifiy that a specific (bus, dev_fn) exists on chaos
*/
-static int __pmac
+static int
chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
{
struct device_node *np;
@@ -252,7 +252,7 @@ chaos_validate_dev(struct pci_bus *bus,
return PCIBIOS_SUCCESSFUL;
}
-static int __pmac
+static int
chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
{
@@ -264,7 +264,7 @@ chaos_read_config(struct pci_bus *bus, u
return macrisc_read_config(bus, devfn, offset, len, val);
}
-static int __pmac
+static int
chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 val)
{
@@ -294,7 +294,7 @@ static struct pci_ops chaos_pci_ops =
+ (((unsigned long)bus) << 16) \
+ 0x01000000UL)
-static void volatile __iomem * __pmac
+static void volatile __iomem *
u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset)
{
if (bus == hose->first_busno) {
@@ -307,7 +307,7 @@ u3_ht_cfg_access(struct pci_controller*
return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
}
-static int __pmac
+static int
u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
{
@@ -357,7 +357,7 @@ u3_ht_read_config(struct pci_bus *bus, u
return PCIBIOS_SUCCESSFUL;
}
-static int __pmac
+static int
u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 val)
{
@@ -899,7 +899,7 @@ pmac_pcibios_fixup(void)
pcibios_fixup_OF_interrupts();
}
-int __pmac
+int
pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
{
struct device_node* node;
@@ -1096,7 +1096,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_
* Disable second function on K2-SATA, it's broken
* and disable IO BARs on first one
*/
-void __pmac pmac_pci_fixup_k2_sata(struct pci_dev* dev)
+void pmac_pci_fixup_k2_sata(struct pci_dev* dev)
{
int i;
u16 cmd;
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -53,7 +53,7 @@ struct pmac_irq_hw {
};
/* Default addresses */
-static volatile struct pmac_irq_hw *pmac_irq_hw[4] __pmacdata = {
+static volatile struct pmac_irq_hw *pmac_irq_hw[4] = {
(struct pmac_irq_hw *) 0xf3000020,
(struct pmac_irq_hw *) 0xf3000010,
(struct pmac_irq_hw *) 0xf4000020,
@@ -64,22 +64,22 @@ static volatile struct pmac_irq_hw *pmac
#define OHARE_LEVEL_MASK 0x1ff00000
#define HEATHROW_LEVEL_MASK 0x1ff00000
-static int max_irqs __pmacdata;
-static int max_real_irqs __pmacdata;
-static u32 level_mask[4] __pmacdata;
+static int max_irqs;
+static int max_real_irqs;
+static u32 level_mask[4];
-static DEFINE_SPINLOCK(pmac_pic_lock __pmacdata);
+static DEFINE_SPINLOCK(pmac_pic_lock);
#define GATWICK_IRQ_POOL_SIZE 10
-static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE] __pmacdata;
+static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
/*
* Mark an irq as "lost". This is only used on the pmac
* since it can lose interrupts (see pmac_set_irq_mask).
* -- Cort
*/
-void __pmac
+void
__set_lost(unsigned long irq_nr, int nokick)
{
if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
@@ -89,7 +89,7 @@ __set_lost(unsigned long irq_nr, int nok
}
}
-static void __pmac
+static void
pmac_mask_and_ack_irq(unsigned int irq_nr)
{
unsigned long bit = 1UL << (irq_nr & 0x1f);
@@ -114,7 +114,7 @@ pmac_mask_and_ack_irq(unsigned int irq_n
spin_unlock_irqrestore(&pmac_pic_lock, flags);
}
-static void __pmac pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
+static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
{
unsigned long bit = 1UL << (irq_nr & 0x1f);
int i = irq_nr >> 5;
@@ -147,7 +147,7 @@ static void __pmac pmac_set_irq_mask(uns
/* When an irq gets requested for the first client, if it's an
* edge interrupt, we clear any previous one on the controller
*/
-static unsigned int __pmac pmac_startup_irq(unsigned int irq_nr)
+static unsigned int pmac_startup_irq(unsigned int irq_nr)
{
unsigned long bit = 1UL << (irq_nr & 0x1f);
int i = irq_nr >> 5;
@@ -160,20 +160,20 @@ static unsigned int __pmac pmac_startup_
return 0;
}
-static void __pmac pmac_mask_irq(unsigned int irq_nr)
+static void pmac_mask_irq(unsigned int irq_nr)
{
clear_bit(irq_nr, ppc_cached_irq_mask);
pmac_set_irq_mask(irq_nr, 0);
mb();
}
-static void __pmac pmac_unmask_irq(unsigned int irq_nr)
+static void pmac_unmask_irq(unsigned int irq_nr)
{
set_bit(irq_nr, ppc_cached_irq_mask);
pmac_set_irq_mask(irq_nr, 0);
}
-static void __pmac pmac_end_irq(unsigned int irq_nr)
+static void pmac_end_irq(unsigned int irq_nr)
{
if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
&& irq_desc[irq_nr].action) {
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -123,7 +123,7 @@ extern struct smp_ops_t psurge_smp_ops;
extern struct smp_ops_t core99_smp_ops;
#endif /* CONFIG_SMP */
-static int __pmac
+static int
pmac_show_cpuinfo(struct seq_file *m)
{
struct device_node *np;
@@ -227,7 +227,7 @@ pmac_show_cpuinfo(struct seq_file *m)
return 0;
}
-static int __openfirmware
+static int
pmac_show_percpuinfo(struct seq_file *m, int i)
{
#ifdef CONFIG_CPU_FREQ_PMAC
@@ -486,7 +486,7 @@ static int pmac_late_init(void)
late_initcall(pmac_late_init);
/* can't be __init - can be called whenever a disk is first accessed */
-void __pmac
+void
note_bootable_part(dev_t dev, int part, int goodness)
{
static int found_boot = 0;
@@ -512,7 +512,7 @@ note_bootable_part(dev_t dev, int part,
}
}
-static void __pmac
+static void
pmac_restart(char *cmd)
{
#ifdef CONFIG_ADB_CUDA
@@ -537,7 +537,7 @@ pmac_restart(char *cmd)
}
}
-static void __pmac
+static void
pmac_power_off(void)
{
#ifdef CONFIG_ADB_CUDA
@@ -562,7 +562,7 @@ pmac_power_off(void)
}
}
-static void __pmac
+static void
pmac_halt(void)
{
pmac_power_off();
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -186,7 +186,7 @@ static inline void psurge_clr_ipi(int cp
*/
static unsigned long psurge_smp_message[NR_CPUS];
-void __pmac psurge_smp_message_recv(struct pt_regs *regs)
+void psurge_smp_message_recv(struct pt_regs *regs)
{
int cpu = smp_processor_id();
int msg;
@@ -203,13 +203,13 @@ void __pmac psurge_smp_message_recv(stru
smp_message_recv(msg, regs);
}
-irqreturn_t __pmac psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
+irqreturn_t psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
{
psurge_smp_message_recv(regs);
return IRQ_HANDLED;
}
-static void __pmac smp_psurge_message_pass(int target, int msg, unsigned long data,
+static void smp_psurge_message_pass(int target, int msg, unsigned long data,
int wait)
{
int i;
@@ -629,7 +629,7 @@ void smp_core99_give_timebase(void)
/* PowerSurge-style Macs */
-struct smp_ops_t psurge_smp_ops __pmacdata = {
+struct smp_ops_t psurge_smp_ops = {
.message_pass = smp_psurge_message_pass,
.probe = smp_psurge_probe,
.kick_cpu = smp_psurge_kick_cpu,
@@ -639,7 +639,7 @@ struct smp_ops_t psurge_smp_ops __pmacda
};
/* Core99 Macs (dual G4s) */
-struct smp_ops_t core99_smp_ops __pmacdata = {
+struct smp_ops_t core99_smp_ops = {
.message_pass = smp_openpic_message_pass,
.probe = smp_core99_probe,
.kick_cpu = smp_core99_kick_cpu,
diff --git a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c
--- a/arch/ppc/platforms/pmac_time.c
+++ b/arch/ppc/platforms/pmac_time.c
@@ -77,7 +77,7 @@ pmac_time_init(void)
#endif
}
-unsigned long __pmac
+unsigned long
pmac_get_rtc_time(void)
{
#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -118,7 +118,7 @@ pmac_get_rtc_time(void)
return 0;
}
-int __pmac
+int
pmac_set_rtc_time(unsigned long nowtime)
{
#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -210,7 +210,7 @@ via_calibrate_decr(void)
/*
* Reset the time after a sleep.
*/
-static int __pmac
+static int
time_sleep_notify(struct pmu_sleep_notifier *self, int when)
{
static unsigned long time_diff;
@@ -235,7 +235,7 @@ time_sleep_notify(struct pmu_sleep_notif
return PBOOK_SLEEP_OK;
}
-static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
+static struct pmu_sleep_notifier time_sleep_notifier = {
time_sleep_notify, SLEEP_LEVEL_MISC,
};
#endif /* CONFIG_PM */
diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
--- a/arch/ppc/platforms/prep_pci.c
+++ b/arch/ppc/platforms/prep_pci.c
@@ -43,7 +43,7 @@ static unsigned long *ProcInfo;
/* Tables for known hardware */
/* Motorola PowerStackII - Utah */
-static char Utah_pci_IRQ_map[23] __prepdata =
+static char Utah_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -72,7 +72,7 @@ static char Utah_pci_IRQ_map[23] __prepd
0, /* Slot 22 - unused */
};
-static char Utah_pci_IRQ_routes[] __prepdata =
+static char Utah_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
9, /* Line 1 */
@@ -84,7 +84,7 @@ static char Utah_pci_IRQ_routes[] __prep
/* Motorola PowerStackII - Omaha */
/* no integrated SCSI or ethernet */
-static char Omaha_pci_IRQ_map[23] __prepdata =
+static char Omaha_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -111,7 +111,7 @@ static char Omaha_pci_IRQ_map[23] __prep
0,
};
-static char Omaha_pci_IRQ_routes[] __prepdata =
+static char Omaha_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
9, /* Line 1 */
@@ -121,7 +121,7 @@ static char Omaha_pci_IRQ_routes[] __pre
};
/* Motorola PowerStack */
-static char Blackhawk_pci_IRQ_map[19] __prepdata =
+static char Blackhawk_pci_IRQ_map[19] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -144,7 +144,7 @@ static char Blackhawk_pci_IRQ_map[19] __
3, /* Slot P5 */
};
-static char Blackhawk_pci_IRQ_routes[] __prepdata =
+static char Blackhawk_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
9, /* Line 1 */
@@ -154,7 +154,7 @@ static char Blackhawk_pci_IRQ_routes[] _
};
/* Motorola Mesquite */
-static char Mesquite_pci_IRQ_map[23] __prepdata =
+static char Mesquite_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -182,7 +182,7 @@ static char Mesquite_pci_IRQ_map[23] __p
};
/* Motorola Sitka */
-static char Sitka_pci_IRQ_map[21] __prepdata =
+static char Sitka_pci_IRQ_map[21] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -208,7 +208,7 @@ static char Sitka_pci_IRQ_map[21] __prep
};
/* Motorola MTX */
-static char MTX_pci_IRQ_map[23] __prepdata =
+static char MTX_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -237,7 +237,7 @@ static char MTX_pci_IRQ_map[23] __prepda
/* Motorola MTX Plus */
/* Secondary bus interrupt routing is not supported yet */
-static char MTXplus_pci_IRQ_map[23] __prepdata =
+static char MTXplus_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -264,13 +264,13 @@ static char MTXplus_pci_IRQ_map[23] __pr
0, /* Slot 22 - unused */
};
-static char Raven_pci_IRQ_routes[] __prepdata =
+static char Raven_pci_IRQ_routes[] =
{
0, /* This is a dummy structure */
};
/* Motorola MVME16xx */
-static char Genesis_pci_IRQ_map[16] __prepdata =
+static char Genesis_pci_IRQ_map[16] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -290,7 +290,7 @@ static char Genesis_pci_IRQ_map[16] __pr
0, /* Slot 15 - unused */
};
-static char Genesis_pci_IRQ_routes[] __prepdata =
+static char Genesis_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
10, /* Line 1 */
@@ -299,7 +299,7 @@ static char Genesis_pci_IRQ_routes[] __p
15 /* Line 4 */
};
-static char Genesis2_pci_IRQ_map[23] __prepdata =
+static char Genesis2_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -327,7 +327,7 @@ static char Genesis2_pci_IRQ_map[23] __p
};
/* Motorola Series-E */
-static char Comet_pci_IRQ_map[23] __prepdata =
+static char Comet_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -354,7 +354,7 @@ static char Comet_pci_IRQ_map[23] __prep
0,
};
-static char Comet_pci_IRQ_routes[] __prepdata =
+static char Comet_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
10, /* Line 1 */
@@ -364,7 +364,7 @@ static char Comet_pci_IRQ_routes[] __pre
};
/* Motorola Series-EX */
-static char Comet2_pci_IRQ_map[23] __prepdata =
+static char Comet2_pci_IRQ_map[23] =
{
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
@@ -391,7 +391,7 @@ static char Comet2_pci_IRQ_map[23] __pre
0,
};
-static char Comet2_pci_IRQ_routes[] __prepdata =
+static char Comet2_pci_IRQ_routes[] =
{
0, /* Line 0 - Unused */
10, /* Line 1 */
@@ -405,7 +405,7 @@ static char Comet2_pci_IRQ_routes[] __pr
* This is actually based on the Carolina motherboard
* -- Cort
*/
-static char ibm8xx_pci_IRQ_map[23] __prepdata = {
+static char ibm8xx_pci_IRQ_map[23] = {
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
0, /* Slot 2 - unused */
@@ -431,7 +431,7 @@ static char ibm8xx_pci_IRQ_map[23] __pre
2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
};
-static char ibm8xx_pci_IRQ_routes[] __prepdata = {
+static char ibm8xx_pci_IRQ_routes[] = {
0, /* Line 0 - unused */
15, /* Line 1 */
15, /* Line 2 */
@@ -443,7 +443,7 @@ static char ibm8xx_pci_IRQ_routes[] __pr
* a 6015 ibm board
* -- Cort
*/
-static char ibm6015_pci_IRQ_map[23] __prepdata = {
+static char ibm6015_pci_IRQ_map[23] = {
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
0, /* Slot 2 - unused */
@@ -469,7 +469,7 @@ static char ibm6015_pci_IRQ_map[23] __pr
2, /* Slot 22 - */
};
-static char ibm6015_pci_IRQ_routes[] __prepdata = {
+static char ibm6015_pci_IRQ_routes[] = {
0, /* Line 0 - unused */
13, /* Line 1 */
15, /* Line 2 */
@@ -479,7 +479,7 @@ static char ibm6015_pci_IRQ_routes[] __p
/* IBM Nobis and Thinkpad 850 */
-static char Nobis_pci_IRQ_map[23] __prepdata ={
+static char Nobis_pci_IRQ_map[23] ={
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
0, /* Slot 2 - unused */
@@ -498,7 +498,7 @@ static char Nobis_pci_IRQ_map[23] __prep
0, /* Slot 15 - unused */
};
-static char Nobis_pci_IRQ_routes[] __prepdata = {
+static char Nobis_pci_IRQ_routes[] = {
0, /* Line 0 - Unused */
13, /* Line 1 */
13, /* Line 2 */
@@ -510,7 +510,7 @@ static char Nobis_pci_IRQ_routes[] __pre
* IBM RS/6000 43p/140 -- paulus
* XXX we should get all this from the residual data
*/
-static char ibm43p_pci_IRQ_map[23] __prepdata = {
+static char ibm43p_pci_IRQ_map[23] = {
0, /* Slot 0 - unused */
0, /* Slot 1 - unused */
0, /* Slot 2 - unused */
@@ -536,7 +536,7 @@ static char ibm43p_pci_IRQ_map[23] __pre
1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
};
-static char ibm43p_pci_IRQ_routes[] __prepdata = {
+static char ibm43p_pci_IRQ_routes[] = {
0, /* Line 0 - unused */
15, /* Line 1 */
15, /* Line 2 */
@@ -559,7 +559,7 @@ struct powerplus_irq_list
* are routed to OpenPIC inputs 5-8. These values are offset by
* 16 in the table to reflect the Linux kernel interrupt value.
*/
-struct powerplus_irq_list Powerplus_pci_IRQ_list __prepdata =
+struct powerplus_irq_list Powerplus_pci_IRQ_list =
{
{25, 26, 27, 28},
{21, 22, 23, 24}
@@ -572,7 +572,7 @@ struct powerplus_irq_list Powerplus_pci_
* are routed to OpenPIC inputs 12-15. These values are offset by
* 16 in the table to reflect the Linux kernel interrupt value.
*/
-struct powerplus_irq_list Mesquite_pci_IRQ_list __prepdata =
+struct powerplus_irq_list Mesquite_pci_IRQ_list =
{
{24, 25, 26, 27},
{28, 29, 30, 31}
@@ -582,7 +582,7 @@ struct powerplus_irq_list Mesquite_pci_I
* This table represents the standard PCI swizzle defined in the
* PCI bus specification.
*/
-static unsigned char prep_pci_intpins[4][4] __prepdata =
+static unsigned char prep_pci_intpins[4][4] =
{
{ 1, 2, 3, 4}, /* Buses 0, 4, 8, ... */
{ 2, 3, 4, 1}, /* Buses 1, 5, 9, ... */
@@ -622,7 +622,7 @@ static unsigned char prep_pci_intpins[4]
#define MIN_DEVNR 11
#define MAX_DEVNR 22
-static int __prep
+static int
prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 *val)
{
@@ -652,7 +652,7 @@ prep_read_config(struct pci_bus *bus, un
return PCIBIOS_SUCCESSFUL;
}
-static int __prep
+static int
prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
int len, u32 val)
{
@@ -804,7 +804,7 @@ struct mot_info {
void (*map_non0_bus)(struct pci_dev *); /* For boards with more than bus 0 devices. */
struct powerplus_irq_list *pci_irq_list; /* List of PCI MPIC inputs */
unsigned char secondary_bridge_devfn; /* devfn of secondary bus transparent bridge */
-} mot_info[] __prepdata = {
+} mot_info[] = {
{0x300, 0x00, 0x00, "MVME 2400", Genesis2_pci_IRQ_map, Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
{0x010, 0x00, 0x00, "Genesis", Genesis_pci_IRQ_map, Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
{0x020, 0x00, 0x00, "Powerstack (Series E)", Comet_pci_IRQ_map, Comet_pci_IRQ_routes, NULL, NULL, 0x00},
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -173,7 +173,7 @@ prep_carolina_enable_l2(void)
}
/* cpuinfo code common to all IBM PReP */
-static void __prep
+static void
prep_ibm_cpuinfo(struct seq_file *m)
{
unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -209,14 +209,14 @@ prep_ibm_cpuinfo(struct seq_file *m)
}
}
-static int __prep
+static int
prep_gen_cpuinfo(struct seq_file *m)
{
prep_ibm_cpuinfo(m);
return 0;
}
-static int __prep
+static int
prep_sandalfoot_cpuinfo(struct seq_file *m)
{
unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -243,7 +243,7 @@ prep_sandalfoot_cpuinfo(struct seq_file
return 0;
}
-static int __prep
+static int
prep_thinkpad_cpuinfo(struct seq_file *m)
{
unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -314,7 +314,7 @@ prep_thinkpad_cpuinfo(struct seq_file *m
return 0;
}
-static int __prep
+static int
prep_carolina_cpuinfo(struct seq_file *m)
{
unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -350,7 +350,7 @@ prep_carolina_cpuinfo(struct seq_file *m
return 0;
}
-static int __prep
+static int
prep_tiger1_cpuinfo(struct seq_file *m)
{
unsigned int l2_reg = inb(PREP_IBM_L2INFO);
@@ -393,7 +393,7 @@ prep_tiger1_cpuinfo(struct seq_file *m)
/* Used by all Motorola PReP */
-static int __prep
+static int
prep_mot_cpuinfo(struct seq_file *m)
{
unsigned int cachew = *((unsigned char *)CACHECRBA);
@@ -454,7 +454,7 @@ no_l2:
return 0;
}
-static void __prep
+static void
prep_restart(char *cmd)
{
#define PREP_SP92 0x92 /* Special Port 92 */
@@ -473,7 +473,7 @@ prep_restart(char *cmd)
#undef PREP_SP92
}
-static void __prep
+static void
prep_halt(void)
{
local_irq_disable(); /* no interrupts */
@@ -488,7 +488,7 @@ prep_halt(void)
/* Carrera is the power manager in the Thinkpads. Unfortunately not much is
* known about it, so we can't power down.
*/
-static void __prep
+static void
prep_carrera_poweroff(void)
{
prep_halt();
@@ -501,7 +501,7 @@ prep_carrera_poweroff(void)
* somewhat in the IBM Carolina Technical Specification.
* -Hollis
*/
-static void __prep
+static void
utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
{
/*
@@ -539,7 +539,7 @@ utah_sig87c750_setbit(unsigned int byten
udelay(100); /* important: let controller recover */
}
-static void __prep
+static void
prep_sig750_poweroff(void)
{
/* tweak the power manager found in most IBM PRePs (except Thinkpads) */
@@ -554,7 +554,7 @@ prep_sig750_poweroff(void)
/* not reached */
}
-static int __prep
+static int
prep_show_percpuinfo(struct seq_file *m, int i)
{
/* PREP's without residual data will give incorrect values here */
@@ -700,12 +700,12 @@ prep_set_bat(void)
/*
* IBM 3-digit status LED
*/
-static unsigned int ibm_statusled_base __prepdata;
+static unsigned int ibm_statusled_base;
-static void __prep
+static void
ibm_statusled_progress(char *s, unsigned short hex);
-static int __prep
+static int
ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
void * dummy3)
{
@@ -713,13 +713,13 @@ ibm_statusled_panic(struct notifier_bloc
return NOTIFY_DONE;
}
-static struct notifier_block ibm_statusled_block __prepdata = {
+static struct notifier_block ibm_statusled_block = {
ibm_statusled_panic,
NULL,
INT_MAX /* try to do it first */
};
-static void __prep
+static void
ibm_statusled_progress(char *s, unsigned short hex)
{
static int notifier_installed;
@@ -945,7 +945,7 @@ prep_calibrate_decr(void)
todc_calibrate_decr();
}
-static unsigned int __prep
+static unsigned int
prep_irq_canonicalize(u_int irq)
{
if (irq == 2)
@@ -996,7 +996,7 @@ prep_init_IRQ(void)
/*
* IDE stuff.
*/
-static int __prep
+static int
prep_ide_default_irq(unsigned long base)
{
switch (base) {
@@ -1010,7 +1010,7 @@ prep_ide_default_irq(unsigned long base)
}
}
-static unsigned long __prep
+static unsigned long
prep_ide_default_io_base(int index)
{
switch (index) {
@@ -1055,7 +1055,7 @@ smp_prep_setup_cpu(int cpu_nr)
do_openpic_setup_cpu();
}
-static struct smp_ops_t prep_smp_ops __prepdata = {
+static struct smp_ops_t prep_smp_ops = {
smp_openpic_message_pass,
smp_prep_probe,
smp_prep_kick_cpu,
diff --git a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
--- a/arch/ppc/platforms/residual.c
+++ b/arch/ppc/platforms/residual.c
@@ -47,7 +47,7 @@
#include <asm/ide.h>
-unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,};
+unsigned char __res[sizeof(RESIDUAL)] = {0,};
RESIDUAL *res = (RESIDUAL *)&__res;
char * PnP_BASE_TYPES[] __initdata = {
diff --git a/arch/ppc/syslib/btext.c b/arch/ppc/syslib/btext.c
--- a/arch/ppc/syslib/btext.c
+++ b/arch/ppc/syslib/btext.c
@@ -53,8 +53,8 @@ extern char *klimit;
* chrp only uses it during early boot.
*/
#ifdef CONFIG_XMON
-#define BTEXT __pmac
-#define BTDATA __pmacdata
+#define BTEXT
+#define BTDATA
#else
#define BTEXT __init
#define BTDATA __initdata
@@ -187,7 +187,7 @@ btext_setup_display(int width, int heigh
* changes.
*/
-void __openfirmware
+void
map_boot_text(void)
{
unsigned long base, offset, size;
diff --git a/arch/ppc/syslib/prep_nvram.c b/arch/ppc/syslib/prep_nvram.c
--- a/arch/ppc/syslib/prep_nvram.c
+++ b/arch/ppc/syslib/prep_nvram.c
@@ -22,14 +22,14 @@
static char nvramData[MAX_PREP_NVRAM];
static NVRAM_MAP *nvram=(NVRAM_MAP *)&nvramData[0];
-unsigned char __prep prep_nvram_read_val(int addr)
+unsigned char prep_nvram_read_val(int addr)
{
outb(addr, PREP_NVRAM_AS0);
outb(addr>>8, PREP_NVRAM_AS1);
return inb(PREP_NVRAM_DATA);
}
-void __prep prep_nvram_write_val(int addr,
+void prep_nvram_write_val(int addr,
unsigned char val)
{
outb(addr, PREP_NVRAM_AS0);
@@ -81,8 +81,7 @@ void __init init_prep_nvram(void)
}
}
-__prep
-char __prep *prep_nvram_get_var(const char *name)
+char *prep_nvram_get_var(const char *name)
{
char *cp;
int namelen;
@@ -101,8 +100,7 @@ char __prep *prep_nvram_get_var(const ch
return NULL;
}
-__prep
-char __prep *prep_nvram_first_var(void)
+char *prep_nvram_first_var(void)
{
if (nvram->Header.GELength == 0) {
return NULL;
@@ -112,8 +110,7 @@ char __prep *prep_nvram_first_var(void)
}
}
-__prep
-char __prep *prep_nvram_next_var(char *name)
+char *prep_nvram_next_var(char *name)
{
char *cp;
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -89,7 +89,7 @@ extern char cmd_line[512]; /* XXX */
extern boot_infos_t *boot_infos;
unsigned long dev_tree_size;
-void __openfirmware
+void
phys_call_rtas(int service, int nargs, int nret, ...)
{
va_list list;
@@ -862,7 +862,7 @@ find_type_devices(const char *type)
/*
* Returns all nodes linked together
*/
-struct device_node * __openfirmware
+struct device_node *
find_all_nodes(void)
{
struct device_node *head, **prevp, *np;
@@ -1165,7 +1165,7 @@ get_property(struct device_node *np, con
/*
* Add a property to a node
*/
-void __openfirmware
+void
prom_add_property(struct device_node* np, struct property* prop)
{
struct property **next = &np->properties;
@@ -1177,7 +1177,7 @@ prom_add_property(struct device_node* np
}
/* I quickly hacked that one, check against spec ! */
-static inline unsigned long __openfirmware
+static inline unsigned long
bus_space_to_resource_flags(unsigned int bus_space)
{
u8 space = (bus_space >> 24) & 0xf;
@@ -1194,7 +1194,7 @@ bus_space_to_resource_flags(unsigned int
}
}
-static struct resource* __openfirmware
+static struct resource*
find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
{
unsigned long mask;
@@ -1224,7 +1224,7 @@ find_parent_pci_resource(struct pci_dev*
* or other nodes attached to the root node. Ultimately, put some
* link to resources in the OF node.
*/
-struct resource* __openfirmware
+struct resource*
request_OF_resource(struct device_node* node, int index, const char* name_postfix)
{
struct pci_dev* pcidev;
@@ -1280,7 +1280,7 @@ fail:
return NULL;
}
-int __openfirmware
+int
release_OF_resource(struct device_node* node, int index)
{
struct pci_dev* pcidev;
@@ -1346,7 +1346,7 @@ release_OF_resource(struct device_node*
}
#if 0
-void __openfirmware
+void
print_properties(struct device_node *np)
{
struct property *pp;
@@ -1400,7 +1400,7 @@ print_properties(struct device_node *np)
static DEFINE_SPINLOCK(rtas_lock);
/* this can be called after setup -- Cort */
-int __openfirmware
+int
call_rtas(const char *service, int nargs, int nret,
unsigned long *outputs, ...)
{
^ permalink raw reply
* Re: PATCH powerpc: 02/04 Remove sections use from ppc64 and drivers
From: Jon Loeliger @ 2005-09-17 15:36 UTC (permalink / raw)
To: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>
diff --git a/arch/ppc64/kernel/pmac_feature.c b/arch/ppc64/kernel/pmac_feature.c
--- a/arch/ppc64/kernel/pmac_feature.c
+++ b/arch/ppc64/kernel/pmac_feature.c
@@ -53,7 +53,7 @@
* We use a single global lock to protect accesses. Each driver has
* to take care of its own locking
*/
-static DEFINE_SPINLOCK(feature_lock __pmacdata);
+static DEFINE_SPINLOCK(feature_lock);
#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
@@ -62,9 +62,9 @@ static DEFINE_SPINLOCK(feature_lock __p
/*
* Instance of some macio stuffs
*/
-struct macio_chip macio_chips[MAX_MACIO_CHIPS] __pmacdata;
+struct macio_chip macio_chips[MAX_MACIO_CHIPS] ;
-struct macio_chip* __pmac macio_find(struct device_node* child, int type)
+struct macio_chip* macio_find(struct device_node* child, int type)
{
while(child) {
int i;
@@ -79,7 +79,7 @@ struct macio_chip* __pmac macio_find(str
}
EXPORT_SYMBOL_GPL(macio_find);
-static const char* macio_names[] __pmacdata =
+static const char* macio_names[] =
{
"Unknown",
"Grand Central",
@@ -106,9 +106,9 @@ static const char* macio_names[] __pmacd
#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
-static struct device_node* uninorth_node __pmacdata;
-static u32* uninorth_base __pmacdata;
-static u32 uninorth_rev __pmacdata;
+static struct device_node* uninorth_node;
+static u32* uninorth_base;
+static u32 uninorth_rev;
static void *u3_ht;
extern struct device_node *k2_skiplist[2];
@@ -133,14 +133,14 @@ struct pmac_mb_def
struct feature_table_entry* features;
unsigned long board_flags;
};
-static struct pmac_mb_def pmac_mb __pmacdata;
+static struct pmac_mb_def pmac_mb;
/*
* Here are the chip specific feature functions
*/
-static long __pmac g5_read_gpio(struct device_node* node, long param, long value)
+static long g5_read_gpio(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -148,7 +148,7 @@ static long __pmac g5_read_gpio(struct d
}
-static long __pmac g5_write_gpio(struct device_node* node, long param, long value)
+static long g5_write_gpio(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
@@ -156,7 +156,7 @@ static long __pmac g5_write_gpio(struct
return 0;
}
-static long __pmac g5_gmac_enable(struct device_node* node, long param, long value)
+static long g5_gmac_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
unsigned long flags;
@@ -181,7 +181,7 @@ static long __pmac g5_gmac_enable(struct
return 0;
}
-static long __pmac g5_fw_enable(struct device_node* node, long param, long value)
+static long g5_fw_enable(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
unsigned long flags;
@@ -206,7 +206,7 @@ static long __pmac g5_fw_enable(struct d
return 0;
}
-static long __pmac g5_mpic_enable(struct device_node* node, long param, long value)
+static long g5_mpic_enable(struct device_node* node, long param, long value)
{
unsigned long flags;
@@ -220,7 +220,7 @@ static long __pmac g5_mpic_enable(struct
return 0;
}
-static long __pmac g5_eth_phy_reset(struct device_node* node, long param, long value)
+static long g5_eth_phy_reset(struct device_node* node, long param, long value)
{
struct macio_chip* macio = &macio_chips[0];
struct device_node *phy;
@@ -250,7 +250,7 @@ static long __pmac g5_eth_phy_reset(stru
return 0;
}
-static long __pmac g5_i2s_enable(struct device_node *node, long param, long value)
+static long g5_i2s_enable(struct device_node *node, long param, long value)
{
/* Very crude implementation for now */
struct macio_chip* macio = &macio_chips[0];
@@ -275,7 +275,7 @@ static long __pmac g5_i2s_enable(struct
#ifdef CONFIG_SMP
-static long __pmac g5_reset_cpu(struct device_node* node, long param, long value)
+static long g5_reset_cpu(struct device_node* node, long param, long value)
{
unsigned int reset_io = 0;
unsigned long flags;
@@ -320,12 +320,12 @@ static long __pmac g5_reset_cpu(struct d
* This takes the second CPU off the bus on dual CPU machines
* running UP
*/
-void __pmac g5_phy_disable_cpu1(void)
+void g5_phy_disable_cpu1(void)
{
UN_OUT(U3_API_PHY_CONFIG_1, 0);
}
-static long __pmac generic_get_mb_info(struct device_node* node, long param, long value)
+static long generic_get_mb_info(struct device_node* node, long param, long value)
{
switch(param) {
case PMAC_MB_INFO_MODEL:
@@ -347,14 +347,14 @@ static long __pmac generic_get_mb_info(s
/* Used on any machine
*/
-static struct feature_table_entry any_features[] __pmacdata = {
+static struct feature_table_entry any_features[] = {
{ PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
{ 0, NULL }
};
/* G5 features
*/
-static struct feature_table_entry g5_features[] __pmacdata = {
+static struct feature_table_entry g5_features[] = {
{ PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
{ PMAC_FTR_1394_ENABLE, g5_fw_enable },
{ PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
@@ -368,7 +368,7 @@ static struct feature_table_entry g5_fea
{ 0, NULL }
};
-static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
+static struct pmac_mb_def pmac_mb_defs[] = {
{ "PowerMac7,2", "PowerMac G5",
PMAC_TYPE_POWERMAC_G5, g5_features,
0,
@@ -394,7 +394,7 @@ static struct pmac_mb_def pmac_mb_defs[]
/*
* The toplevel feature_call callback
*/
-long __pmac pmac_do_feature_call(unsigned int selector, ...)
+long pmac_do_feature_call(unsigned int selector, ...)
{
struct device_node* node;
long param, value;
@@ -706,8 +706,8 @@ void __init pmac_check_ht_link(void)
* Early video resume hook
*/
-static void (*pmac_early_vresume_proc)(void *data) __pmacdata;
-static void *pmac_early_vresume_data __pmacdata;
+static void (*pmac_early_vresume_proc)(void *data);
+static void *pmac_early_vresume_data;
void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
{
@@ -725,11 +725,11 @@ EXPORT_SYMBOL(pmac_set_early_video_resum
* AGP related suspend/resume code
*/
-static struct pci_dev *pmac_agp_bridge __pmacdata;
-static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata;
-static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata;
+static struct pci_dev *pmac_agp_bridge;
+static int (*pmac_agp_suspend)(struct pci_dev *bridge);
+static int (*pmac_agp_resume)(struct pci_dev *bridge);
-void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
+void pmac_register_agp_pm(struct pci_dev *bridge,
int (*suspend)(struct pci_dev *bridge),
int (*resume)(struct pci_dev *bridge))
{
@@ -746,7 +746,7 @@ void __pmac pmac_register_agp_pm(struct
}
EXPORT_SYMBOL(pmac_register_agp_pm);
-void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
+void pmac_suspend_agp_for_card(struct pci_dev *dev)
{
if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
return;
@@ -756,7 +756,7 @@ void __pmac pmac_suspend_agp_for_card(st
}
EXPORT_SYMBOL(pmac_suspend_agp_for_card);
-void __pmac pmac_resume_agp_for_card(struct pci_dev *dev)
+void pmac_resume_agp_for_card(struct pci_dev *dev)
{
if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
return;
diff --git a/arch/ppc64/kernel/pmac_nvram.c b/arch/ppc64/kernel/pmac_nvram.c
--- a/arch/ppc64/kernel/pmac_nvram.c
+++ b/arch/ppc64/kernel/pmac_nvram.c
@@ -82,10 +82,10 @@ extern int system_running;
static int (*core99_write_bank)(int bank, u8* datas);
static int (*core99_erase_bank)(int bank);
-static char *nvram_image __pmacdata;
+static char *nvram_image;
-static ssize_t __pmac core99_nvram_read(char *buf, size_t count, loff_t *index)
+static ssize_t core99_nvram_read(char *buf, size_t count, loff_t *index)
{
int i;
@@ -103,7 +103,7 @@ static ssize_t __pmac core99_nvram_read(
return count;
}
-static ssize_t __pmac core99_nvram_write(char *buf, size_t count, loff_t *index)
+static ssize_t core99_nvram_write(char *buf, size_t count, loff_t *index)
{
int i;
@@ -121,14 +121,14 @@ static ssize_t __pmac core99_nvram_write
return count;
}
-static ssize_t __pmac core99_nvram_size(void)
+static ssize_t core99_nvram_size(void)
{
if (nvram_image == NULL)
return -ENODEV;
return NVRAM_SIZE;
}
-static u8 __pmac chrp_checksum(struct chrp_header* hdr)
+static u8 chrp_checksum(struct chrp_header* hdr)
{
u8 *ptr;
u16 sum = hdr->signature;
@@ -139,7 +139,7 @@ static u8 __pmac chrp_checksum(struct ch
return sum;
}
-static u32 __pmac core99_calc_adler(u8 *buffer)
+static u32 core99_calc_adler(u8 *buffer)
{
int cnt;
u32 low, high;
@@ -161,7 +161,7 @@ static u32 __pmac core99_calc_adler(u8 *
return (high << 16) | low;
}
-static u32 __pmac core99_check(u8* datas)
+static u32 core99_check(u8* datas)
{
struct core99_header* hdr99 = (struct core99_header*)datas;
@@ -180,7 +180,7 @@ static u32 __pmac core99_check(u8* datas
return hdr99->generation;
}
-static int __pmac sm_erase_bank(int bank)
+static int sm_erase_bank(int bank)
{
int stat, i;
unsigned long timeout;
@@ -212,7 +212,7 @@ static int __pmac sm_erase_bank(int bank
return 0;
}
-static int __pmac sm_write_bank(int bank, u8* datas)
+static int sm_write_bank(int bank, u8* datas)
{
int i, stat = 0;
unsigned long timeout;
@@ -247,7 +247,7 @@ static int __pmac sm_write_bank(int bank
return 0;
}
-static int __pmac amd_erase_bank(int bank)
+static int amd_erase_bank(int bank)
{
int i, stat = 0;
unsigned long timeout;
@@ -294,7 +294,7 @@ static int __pmac amd_erase_bank(int ban
return 0;
}
-static int __pmac amd_write_bank(int bank, u8* datas)
+static int amd_write_bank(int bank, u8* datas)
{
int i, stat = 0;
unsigned long timeout;
@@ -341,7 +341,7 @@ static int __pmac amd_write_bank(int ban
}
-static int __pmac core99_nvram_sync(void)
+static int core99_nvram_sync(void)
{
struct core99_header* hdr99;
unsigned long flags;
@@ -431,7 +431,7 @@ int __init pmac_nvram_init(void)
return 0;
}
-int __pmac pmac_get_partition(int partition)
+int pmac_get_partition(int partition)
{
struct nvram_partition *part;
const char *name;
@@ -459,7 +459,7 @@ int __pmac pmac_get_partition(int partit
return part->index;
}
-u8 __pmac pmac_xpram_read(int xpaddr)
+u8 pmac_xpram_read(int xpaddr)
{
int offset = pmac_get_partition(pmac_nvram_XPRAM);
loff_t index;
@@ -476,7 +476,7 @@ u8 __pmac pmac_xpram_read(int xpaddr)
return buf;
}
-void __pmac pmac_xpram_write(int xpaddr, u8 data)
+void pmac_xpram_write(int xpaddr, u8 data)
{
int offset = pmac_get_partition(pmac_nvram_XPRAM);
loff_t index;
diff --git a/arch/ppc64/kernel/pmac_pci.c b/arch/ppc64/kernel/pmac_pci.c
--- a/arch/ppc64/kernel/pmac_pci.c
+++ b/arch/ppc64/kernel/pmac_pci.c
@@ -121,7 +121,7 @@ static void __init fixup_bus_range(struc
|(((unsigned long)(off)) & 0xFCUL) \
|1UL)
-static unsigned long __pmac macrisc_cfg_access(struct pci_controller* hose,
+static unsigned long macrisc_cfg_access(struct pci_controller* hose,
u8 bus, u8 dev_fn, u8 offset)
{
unsigned int caddr;
@@ -142,7 +142,7 @@ static unsigned long __pmac macrisc_cfg_
return ((unsigned long)hose->cfg_data) + offset;
}
-static int __pmac macrisc_read_config(struct pci_bus *bus, unsigned int devfn,
+static int macrisc_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val)
{
struct pci_controller *hose;
@@ -173,7 +173,7 @@ static int __pmac macrisc_read_config(st
return PCIBIOS_SUCCESSFUL;
}
-static int __pmac macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
+static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val)
{
struct pci_controller *hose;
@@ -265,7 +265,7 @@ static int u3_ht_skip_device(struct pci_
+ (((unsigned long)bus) << 16) \
+ 0x01000000UL)
-static unsigned long __pmac u3_ht_cfg_access(struct pci_controller* hose,
+static unsigned long u3_ht_cfg_access(struct pci_controller* hose,
u8 bus, u8 devfn, u8 offset)
{
if (bus == hose->first_busno) {
@@ -277,7 +277,7 @@ static unsigned long __pmac u3_ht_cfg_ac
return ((unsigned long)hose->cfg_data) + U3_HT_CFA1(bus, devfn, offset);
}
-static int __pmac u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
+static int u3_ht_read_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 *val)
{
struct pci_controller *hose;
@@ -327,7 +327,7 @@ static int __pmac u3_ht_read_config(stru
return PCIBIOS_SUCCESSFUL;
}
-static int __pmac u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
+static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val)
{
struct pci_controller *hose;
diff --git a/arch/ppc64/kernel/pmac_setup.c b/arch/ppc64/kernel/pmac_setup.c
--- a/arch/ppc64/kernel/pmac_setup.c
+++ b/arch/ppc64/kernel/pmac_setup.c
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(smu_cmdbuf_abs);
extern void udbg_init_scc(struct device_node *np);
-static void __pmac pmac_show_cpuinfo(struct seq_file *m)
+static void pmac_show_cpuinfo(struct seq_file *m)
{
struct device_node *np;
char *pp;
@@ -210,7 +210,7 @@ static int pmac_late_init(void)
late_initcall(pmac_late_init);
/* can't be __init - can be called whenever a disk is first accessed */
-void __pmac note_bootable_part(dev_t dev, int part, int goodness)
+void note_bootable_part(dev_t dev, int part, int goodness)
{
extern dev_t boot_dev;
char *p;
@@ -231,7 +231,7 @@ void __pmac note_bootable_part(dev_t dev
}
}
-static void __pmac pmac_restart(char *cmd)
+static void pmac_restart(char *cmd)
{
switch(sys_ctrler) {
#ifdef CONFIG_ADB_PMU
@@ -250,7 +250,7 @@ static void __pmac pmac_restart(char *cm
}
}
-static void __pmac pmac_power_off(void)
+static void pmac_power_off(void)
{
switch(sys_ctrler) {
#ifdef CONFIG_ADB_PMU
@@ -268,7 +268,7 @@ static void __pmac pmac_power_off(void)
}
}
-static void __pmac pmac_halt(void)
+static void pmac_halt(void)
{
pmac_power_off();
}
diff --git a/arch/ppc64/kernel/pmac_smp.c b/arch/ppc64/kernel/pmac_smp.c
--- a/arch/ppc64/kernel/pmac_smp.c
+++ b/arch/ppc64/kernel/pmac_smp.c
@@ -310,7 +310,7 @@ static void __init smp_core99_setup_cpu(
}
}
-struct smp_ops_t core99_smp_ops __pmacdata = {
+struct smp_ops_t core99_smp_ops = {
.message_pass = smp_mpic_message_pass,
.probe = smp_core99_probe,
.kick_cpu = smp_core99_kick_cpu,
diff --git a/arch/ppc64/kernel/pmac_time.c b/arch/ppc64/kernel/pmac_time.c
--- a/arch/ppc64/kernel/pmac_time.c
+++ b/arch/ppc64/kernel/pmac_time.c
@@ -51,7 +51,7 @@
extern struct timezone sys_tz;
extern void to_tm(int tim, struct rtc_time * tm);
-void __pmac pmac_get_rtc_time(struct rtc_time *tm)
+void pmac_get_rtc_time(struct rtc_time *tm)
{
switch(sys_ctrler) {
#ifdef CONFIG_ADB_PMU
@@ -92,7 +92,7 @@ void __pmac pmac_get_rtc_time(struct rtc
}
}
-int __pmac pmac_set_rtc_time(struct rtc_time *tm)
+int pmac_set_rtc_time(struct rtc_time *tm)
{
switch(sys_ctrler) {
#ifdef CONFIG_ADB_PMU
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -81,7 +81,7 @@ typedef struct pmac_ide_hwif {
} pmac_ide_hwif_t;
-static pmac_ide_hwif_t pmac_ide[MAX_HWIFS] __pmacdata;
+static pmac_ide_hwif_t pmac_ide[MAX_HWIFS];
static int pmac_ide_count;
enum {
@@ -242,7 +242,7 @@ struct mdma_timings_t {
int cycleTime;
};
-struct mdma_timings_t mdma_timings_33[] __pmacdata =
+struct mdma_timings_t mdma_timings_33[] =
{
{ 240, 240, 480 },
{ 180, 180, 360 },
@@ -255,7 +255,7 @@ struct mdma_timings_t mdma_timings_33[]
{ 0, 0, 0 }
};
-struct mdma_timings_t mdma_timings_33k[] __pmacdata =
+struct mdma_timings_t mdma_timings_33k[] =
{
{ 240, 240, 480 },
{ 180, 180, 360 },
@@ -268,7 +268,7 @@ struct mdma_timings_t mdma_timings_33k[]
{ 0, 0, 0 }
};
-struct mdma_timings_t mdma_timings_66[] __pmacdata =
+struct mdma_timings_t mdma_timings_66[] =
{
{ 240, 240, 480 },
{ 180, 180, 360 },
@@ -286,7 +286,7 @@ struct {
int addrSetup; /* ??? */
int rdy2pause;
int wrDataSetup;
-} kl66_udma_timings[] __pmacdata =
+} kl66_udma_timings[] =
{
{ 0, 180, 120 }, /* Mode 0 */
{ 0, 150, 90 }, /* 1 */
@@ -301,7 +301,7 @@ struct kauai_timing {
u32 timing_reg;
};
-static struct kauai_timing kauai_pio_timings[] __pmacdata =
+static struct kauai_timing kauai_pio_timings[] =
{
{ 930 , 0x08000fff },
{ 600 , 0x08000a92 },
@@ -316,7 +316,7 @@ static struct kauai_timing kauai_pio_tim
{ 120 , 0x04000148 }
};
-static struct kauai_timing kauai_mdma_timings[] __pmacdata =
+static struct kauai_timing kauai_mdma_timings[] =
{
{ 1260 , 0x00fff000 },
{ 480 , 0x00618000 },
@@ -330,7 +330,7 @@ static struct kauai_timing kauai_mdma_ti
{ 0 , 0 },
};
-static struct kauai_timing kauai_udma_timings[] __pmacdata =
+static struct kauai_timing kauai_udma_timings[] =
{
{ 120 , 0x000070c0 },
{ 90 , 0x00005d80 },
@@ -341,7 +341,7 @@ static struct kauai_timing kauai_udma_ti
{ 0 , 0 },
};
-static struct kauai_timing shasta_pio_timings[] __pmacdata =
+static struct kauai_timing shasta_pio_timings[] =
{
{ 930 , 0x08000fff },
{ 600 , 0x0A000c97 },
@@ -356,7 +356,7 @@ static struct kauai_timing shasta_pio_ti
{ 120 , 0x0400010a }
};
-static struct kauai_timing shasta_mdma_timings[] __pmacdata =
+static struct kauai_timing shasta_mdma_timings[] =
{
{ 1260 , 0x00fff000 },
{ 480 , 0x00820800 },
@@ -370,7 +370,7 @@ static struct kauai_timing shasta_mdma_t
{ 0 , 0 },
};
-static struct kauai_timing shasta_udma133_timings[] __pmacdata =
+static struct kauai_timing shasta_udma133_timings[] =
{
{ 120 , 0x00035901, },
{ 90 , 0x000348b1, },
@@ -522,7 +522,7 @@ pmu_hd_blink_init(void)
* N.B. this can't be an initfunc, because the media-bay task can
* call ide_[un]register at any time.
*/
-void __pmac
+void
pmac_ide_init_hwif_ports(hw_regs_t *hw,
unsigned long data_port, unsigned long ctrl_port,
int *irq)
@@ -559,7 +559,7 @@ pmac_ide_init_hwif_ports(hw_regs_t *hw,
* timing register when selecting that unit. This version is for
* ASICs with a single timing register
*/
-static void __pmac
+static void
pmac_ide_selectproc(ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -579,7 +579,7 @@ pmac_ide_selectproc(ide_drive_t *drive)
* timing register when selecting that unit. This version is for
* ASICs with a dual timing register (Kauai)
*/
-static void __pmac
+static void
pmac_ide_kauai_selectproc(ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -600,7 +600,7 @@ pmac_ide_kauai_selectproc(ide_drive_t *d
/*
* Force an update of controller timing values for a given drive
*/
-static void __pmac
+static void
pmac_ide_do_update_timings(ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -633,7 +633,7 @@ pmac_outbsync(ide_drive_t *drive, u8 val
* to sort that out sooner or later and see if I can finally get the
* common version to work properly in all cases
*/
-static int __pmac
+static int
pmac_ide_do_setfeature(ide_drive_t *drive, u8 command)
{
ide_hwif_t *hwif = HWIF(drive);
@@ -710,7 +710,7 @@ out:
/*
* Old tuning functions (called on hdparm -p), sets up drive PIO timings
*/
-static void __pmac
+static void
pmac_ide_tuneproc(ide_drive_t *drive, u8 pio)
{
ide_pio_data_t d;
@@ -801,7 +801,7 @@ pmac_ide_tuneproc(ide_drive_t *drive, u8
/*
* Calculate KeyLargo ATA/66 UDMA timings
*/
-static int __pmac
+static int
set_timings_udma_ata4(u32 *timings, u8 speed)
{
unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks;
@@ -829,7 +829,7 @@ set_timings_udma_ata4(u32 *timings, u8 s
/*
* Calculate Kauai ATA/100 UDMA timings
*/
-static int __pmac
+static int
set_timings_udma_ata6(u32 *pio_timings, u32 *ultra_timings, u8 speed)
{
struct ide_timing *t = ide_timing_find_mode(speed);
@@ -849,7 +849,7 @@ set_timings_udma_ata6(u32 *pio_timings,
/*
* Calculate Shasta ATA/133 UDMA timings
*/
-static int __pmac
+static int
set_timings_udma_shasta(u32 *pio_timings, u32 *ultra_timings, u8 speed)
{
struct ide_timing *t = ide_timing_find_mode(speed);
@@ -869,7 +869,7 @@ set_timings_udma_shasta(u32 *pio_timings
/*
* Calculate MDMA timings for all cells
*/
-static int __pmac
+static int
set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2,
u8 speed, int drive_cycle_time)
{
@@ -1014,7 +1014,7 @@ set_timings_mdma(ide_drive_t *drive, int
* our dedicated function is more precise as it uses the drive provided
* cycle time value. We should probably fix this one to deal with that too...
*/
-static int __pmac
+static int
pmac_ide_tune_chipset (ide_drive_t *drive, byte speed)
{
int unit = (drive->select.b.unit & 0x01);
@@ -1092,7 +1092,7 @@ pmac_ide_tune_chipset (ide_drive_t *driv
* Blast some well known "safe" values to the timing registers at init or
* wakeup from sleep time, before we do real calculation
*/
-static void __pmac
+static void
sanitize_timings(pmac_ide_hwif_t *pmif)
{
unsigned int value, value2 = 0;
@@ -1123,13 +1123,13 @@ sanitize_timings(pmac_ide_hwif_t *pmif)
pmif->timings[2] = pmif->timings[3] = value2;
}
-unsigned long __pmac
+unsigned long
pmac_ide_get_base(int index)
{
return pmac_ide[index].regbase;
}
-int __pmac
+int
pmac_ide_check_base(unsigned long base)
{
int ix;
@@ -1140,7 +1140,7 @@ pmac_ide_check_base(unsigned long base)
return -1;
}
-int __pmac
+int
pmac_ide_get_irq(unsigned long base)
{
int ix;
@@ -1151,7 +1151,7 @@ pmac_ide_get_irq(unsigned long base)
return 0;
}
-static int ide_majors[] __pmacdata = { 3, 22, 33, 34, 56, 57 };
+static int ide_majors[] = { 3, 22, 33, 34, 56, 57 };
dev_t __init
pmac_find_ide_boot(char *bootdevice, int n)
@@ -1701,7 +1701,7 @@ pmac_ide_probe(void)
* pmac_ide_build_dmatable builds the DBDMA command list
* for a transfer and sets the DBDMA channel to point to it.
*/
-static int __pmac
+static int
pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq)
{
struct dbdma_cmd *table;
@@ -1785,7 +1785,7 @@ pmac_ide_build_dmatable(ide_drive_t *dri
}
/* Teardown mappings after DMA has completed. */
-static void __pmac
+static void
pmac_ide_destroy_dmatable (ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
@@ -1802,7 +1802,7 @@ pmac_ide_destroy_dmatable (ide_drive_t *
/*
* Pick up best MDMA timing for the drive and apply it
*/
-static int __pmac
+static int
pmac_ide_mdma_enable(ide_drive_t *drive, u16 mode)
{
ide_hwif_t *hwif = HWIF(drive);
@@ -1859,7 +1859,7 @@ pmac_ide_mdma_enable(ide_drive_t *drive,
/*
* Pick up best UDMA timing for the drive and apply it
*/
-static int __pmac
+static int
pmac_ide_udma_enable(ide_drive_t *drive, u16 mode)
{
ide_hwif_t *hwif = HWIF(drive);
@@ -1915,7 +1915,7 @@ pmac_ide_udma_enable(ide_drive_t *drive,
* Check what is the best DMA timing setting for the drive and
* call appropriate functions to apply it.
*/
-static int __pmac
+static int
pmac_ide_dma_check(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
@@ -1967,7 +1967,7 @@ pmac_ide_dma_check(ide_drive_t *drive)
* Prepare a DMA transfer. We build the DMA table, adjust the timings for
* a read on KeyLargo ATA/66 and mark us as waiting for DMA completion
*/
-static int __pmac
+static int
pmac_ide_dma_setup(ide_drive_t *drive)
{
ide_hwif_t *hwif = HWIF(drive);
@@ -1997,7 +1997,7 @@ pmac_ide_dma_setup(ide_drive_t *drive)
return 0;
}
-static void __pmac
+static void
pmac_ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
{
/* issue cmd to drive */
@@ -2008,7 +2008,7 @@ pmac_ide_dma_exec_cmd(ide_drive_t *drive
* Kick the DMA controller into life after the DMA command has been issued
* to the drive.
*/
-static void __pmac
+static void
pmac_ide_dma_start(ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -2024,7 +2024,7 @@ pmac_ide_dma_start(ide_drive_t *drive)
/*
* After a DMA transfer, make sure the controller is stopped
*/
-static int __pmac
+static int
pmac_ide_dma_end (ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -2052,7 +2052,7 @@ pmac_ide_dma_end (ide_drive_t *drive)
* that's not implemented yet), on the other hand, we don't have shared interrupts
* so it's not really a problem
*/
-static int __pmac
+static int
pmac_ide_dma_test_irq (ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
@@ -2108,19 +2108,19 @@ pmac_ide_dma_test_irq (ide_drive_t *driv
return 1;
}
-static int __pmac
+static int
pmac_ide_dma_host_off (ide_drive_t *drive)
{
return 0;
}
-static int __pmac
+static int
pmac_ide_dma_host_on (ide_drive_t *drive)
{
return 0;
}
-static int __pmac
+static int
pmac_ide_dma_lostirq (ide_drive_t *drive)
{
pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data;
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -27,7 +27,7 @@ static volatile unsigned char __iomem *a
#undef DEBUG
-static void __pmac
+static void
anslcd_write_byte_ctrl ( unsigned char c )
{
#ifdef DEBUG
@@ -43,14 +43,14 @@ anslcd_write_byte_ctrl ( unsigned char c
}
}
-static void __pmac
+static void
anslcd_write_byte_data ( unsigned char c )
{
out_8(anslcd_ptr + ANSLCD_DATA_IX, c);
udelay(anslcd_short_delay);
}
-static ssize_t __pmac
+static ssize_t
anslcd_write( struct file * file, const char __user * buf,
size_t count, loff_t *ppos )
{
@@ -73,7 +73,7 @@ anslcd_write( struct file * file, const
return p - buf;
}
-static int __pmac
+static int
anslcd_ioctl( struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg )
{
@@ -115,7 +115,7 @@ anslcd_ioctl( struct inode * inode, stru
}
}
-static int __pmac
+static int
anslcd_open( struct inode * inode, struct file * file )
{
return 0;
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -167,19 +167,19 @@ enum {
* Functions for polling content of media bay
*/
-static u8 __pmac
+static u8
ohare_mb_content(struct media_bay_info *bay)
{
return (MB_IN32(bay, OHARE_MBCR) >> 12) & 7;
}
-static u8 __pmac
+static u8
heathrow_mb_content(struct media_bay_info *bay)
{
return (MB_IN32(bay, HEATHROW_MBCR) >> 12) & 7;
}
-static u8 __pmac
+static u8
keylargo_mb_content(struct media_bay_info *bay)
{
int new_gpio;
@@ -205,7 +205,7 @@ keylargo_mb_content(struct media_bay_inf
* into reset state as well
*/
-static void __pmac
+static void
ohare_mb_power(struct media_bay_info* bay, int on_off)
{
if (on_off) {
@@ -224,7 +224,7 @@ ohare_mb_power(struct media_bay_info* ba
MB_BIC(bay, OHARE_MBCR, 0x00000F00);
}
-static void __pmac
+static void
heathrow_mb_power(struct media_bay_info* bay, int on_off)
{
if (on_off) {
@@ -243,7 +243,7 @@ heathrow_mb_power(struct media_bay_info*
MB_BIC(bay, HEATHROW_MBCR, 0x00000F00);
}
-static void __pmac
+static void
keylargo_mb_power(struct media_bay_info* bay, int on_off)
{
if (on_off) {
@@ -267,7 +267,7 @@ keylargo_mb_power(struct media_bay_info*
* enable the related busses
*/
-static int __pmac
+static int
ohare_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
{
switch(device_id) {
@@ -287,7 +287,7 @@ ohare_mb_setup_bus(struct media_bay_info
return -ENODEV;
}
-static int __pmac
+static int
heathrow_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
{
switch(device_id) {
@@ -307,7 +307,7 @@ heathrow_mb_setup_bus(struct media_bay_i
return -ENODEV;
}
-static int __pmac
+static int
keylargo_mb_setup_bus(struct media_bay_info* bay, u8 device_id)
{
switch(device_id) {
@@ -330,43 +330,43 @@ keylargo_mb_setup_bus(struct media_bay_i
* Functions for tweaking resets
*/
-static void __pmac
+static void
ohare_mb_un_reset(struct media_bay_info* bay)
{
MB_BIS(bay, OHARE_FCR, OH_BAY_RESET_N);
}
-static void __pmac keylargo_mb_init(struct media_bay_info *bay)
+static void keylargo_mb_init(struct media_bay_info *bay)
{
MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_ENABLE);
}
-static void __pmac heathrow_mb_un_reset(struct media_bay_info* bay)
+static void heathrow_mb_un_reset(struct media_bay_info* bay)
{
MB_BIS(bay, HEATHROW_FCR, HRW_BAY_RESET_N);
}
-static void __pmac keylargo_mb_un_reset(struct media_bay_info* bay)
+static void keylargo_mb_un_reset(struct media_bay_info* bay)
{
MB_BIS(bay, KEYLARGO_MBCR, KL_MBCR_MB0_DEV_RESET);
}
-static void __pmac ohare_mb_un_reset_ide(struct media_bay_info* bay)
+static void ohare_mb_un_reset_ide(struct media_bay_info* bay)
{
MB_BIS(bay, OHARE_FCR, OH_IDE1_RESET_N);
}
-static void __pmac heathrow_mb_un_reset_ide(struct media_bay_info* bay)
+static void heathrow_mb_un_reset_ide(struct media_bay_info* bay)
{
MB_BIS(bay, HEATHROW_FCR, HRW_IDE1_RESET_N);
}
-static void __pmac keylargo_mb_un_reset_ide(struct media_bay_info* bay)
+static void keylargo_mb_un_reset_ide(struct media_bay_info* bay)
{
MB_BIS(bay, KEYLARGO_FCR1, KL1_EIDE0_RESET_N);
}
-static inline void __pmac set_mb_power(struct media_bay_info* bay, int onoff)
+static inline void set_mb_power(struct media_bay_info* bay, int onoff)
{
/* Power up up and assert the bay reset line */
if (onoff) {
@@ -382,7 +382,7 @@ static inline void __pmac set_mb_power(s
bay->timer = msecs_to_jiffies(MB_POWER_DELAY);
}
-static void __pmac poll_media_bay(struct media_bay_info* bay)
+static void poll_media_bay(struct media_bay_info* bay)
{
int id = bay->ops->content(bay);
@@ -415,7 +415,7 @@ static void __pmac poll_media_bay(struct
}
}
-int __pmac check_media_bay(struct device_node *which_bay, int what)
+int check_media_bay(struct device_node *which_bay, int what)
{
#ifdef CONFIG_BLK_DEV_IDE
int i;
@@ -432,7 +432,7 @@ int __pmac check_media_bay(struct device
}
EXPORT_SYMBOL(check_media_bay);
-int __pmac check_media_bay_by_base(unsigned long base, int what)
+int check_media_bay_by_base(unsigned long base, int what)
{
#ifdef CONFIG_BLK_DEV_IDE
int i;
@@ -449,7 +449,7 @@ int __pmac check_media_bay_by_base(unsig
return -ENODEV;
}
-int __pmac media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
+int media_bay_set_ide_infos(struct device_node* which_bay, unsigned long base,
int irq, int index)
{
#ifdef CONFIG_BLK_DEV_IDE
@@ -489,7 +489,7 @@ int __pmac media_bay_set_ide_infos(struc
return -ENODEV;
}
-static void __pmac media_bay_step(int i)
+static void media_bay_step(int i)
{
struct media_bay_info* bay = &media_bays[i];
@@ -619,7 +619,7 @@ static void __pmac media_bay_step(int i)
* with the IDE driver. It needs to be a thread because
* ide_register can't be called from interrupt context.
*/
-static int __pmac media_bay_task(void *x)
+static int media_bay_task(void *x)
{
int i;
@@ -704,7 +704,7 @@ static int __devinit media_bay_attach(st
}
-static int __pmac media_bay_suspend(struct macio_dev *mdev, pm_message_t state)
+static int media_bay_suspend(struct macio_dev *mdev, pm_message_t state)
{
struct media_bay_info *bay = macio_get_drvdata(mdev);
@@ -719,7 +719,7 @@ static int __pmac media_bay_suspend(stru
return 0;
}
-static int __pmac media_bay_resume(struct macio_dev *mdev)
+static int media_bay_resume(struct macio_dev *mdev)
{
struct media_bay_info *bay = macio_get_drvdata(mdev);
@@ -760,7 +760,7 @@ static int __pmac media_bay_resume(struc
/* Definitions of "ops" structures.
*/
-static struct mb_ops ohare_mb_ops __pmacdata = {
+static struct mb_ops ohare_mb_ops = {
.name = "Ohare",
.content = ohare_mb_content,
.power = ohare_mb_power,
@@ -769,7 +769,7 @@ static struct mb_ops ohare_mb_ops __pmac
.un_reset_ide = ohare_mb_un_reset_ide,
};
-static struct mb_ops heathrow_mb_ops __pmacdata = {
+static struct mb_ops heathrow_mb_ops = {
.name = "Heathrow",
.content = heathrow_mb_content,
.power = heathrow_mb_power,
@@ -778,7 +778,7 @@ static struct mb_ops heathrow_mb_ops __p
.un_reset_ide = heathrow_mb_un_reset_ide,
};
-static struct mb_ops keylargo_mb_ops __pmacdata = {
+static struct mb_ops keylargo_mb_ops = {
.name = "KeyLargo",
.init = keylargo_mb_init,
.content = keylargo_mb_content,
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -37,7 +37,6 @@ static DEFINE_SPINLOCK(cuda_lock);
#ifdef CONFIG_MAC
#define CUDA_IRQ IRQ_MAC_ADB
-#define __openfirmware
#define eieio()
#else
#define CUDA_IRQ vias->intrs[0].line
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -244,7 +244,7 @@ int pmu_wink(struct adb_request *req);
* - the number of response bytes which the PMU will return, or
* -1 if it will send a length byte.
*/
-static const s8 pmu_data_len[256][2] __openfirmwaredata = {
+static const s8 pmu_data_len[256][2] = {
/* 0 1 2 3 4 5 6 7 */
/*00*/ {-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},{-1, 0},
/*08*/ {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
@@ -295,7 +295,7 @@ static struct backlight_controller pmu_b
};
#endif /* CONFIG_PMAC_BACKLIGHT */
-int __openfirmware
+int
find_via_pmu(void)
{
if (via != 0)
@@ -374,7 +374,7 @@ find_via_pmu(void)
}
#ifdef CONFIG_ADB
-static int __openfirmware
+static int
pmu_probe(void)
{
return vias == NULL? -ENODEV: 0;
@@ -520,7 +520,7 @@ static int __init via_pmu_dev_init(void)
device_initcall(via_pmu_dev_init);
-static int __openfirmware
+static int
init_pmu(void)
{
int timeout;
@@ -625,7 +625,7 @@ static void pmu_set_server_mode(int serv
/* This new version of the code for 2400/3400/3500 powerbooks
* is inspired from the implementation in gkrellm-pmu
*/
-static void __pmac
+static void
done_battery_state_ohare(struct adb_request* req)
{
/* format:
@@ -713,7 +713,7 @@ done_battery_state_ohare(struct adb_requ
clear_bit(0, &async_req_locks);
}
-static void __pmac
+static void
done_battery_state_smart(struct adb_request* req)
{
/* format:
@@ -791,7 +791,7 @@ done_battery_state_smart(struct adb_requ
clear_bit(0, &async_req_locks);
}
-static void __pmac
+static void
query_battery_state(void)
{
if (test_and_set_bit(0, &async_req_locks))
@@ -804,7 +804,7 @@ query_battery_state(void)
2, PMU_SMART_BATTERY_STATE, pmu_cur_battery+1);
}
-static int __pmac
+static int
proc_get_info(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -819,7 +819,7 @@ proc_get_info(char *page, char **start,
return p - page;
}
-static int __pmac
+static int
proc_get_irqstats(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -846,7 +846,7 @@ proc_get_irqstats(char *page, char **sta
return p - page;
}
-static int __pmac
+static int
proc_get_batt(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -870,7 +870,7 @@ proc_get_batt(char *page, char **start,
return p - page;
}
-static int __pmac
+static int
proc_read_options(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -887,7 +887,7 @@ proc_read_options(char *page, char **sta
return p - page;
}
-static int __pmac
+static int
proc_write_options(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
@@ -934,7 +934,7 @@ proc_write_options(struct file *file, co
#ifdef CONFIG_ADB
/* Send an ADB command */
-static int __pmac
+static int
pmu_send_request(struct adb_request *req, int sync)
{
int i, ret;
@@ -1014,7 +1014,7 @@ pmu_send_request(struct adb_request *req
}
/* Enable/disable autopolling */
-static int __pmac
+static int
pmu_adb_autopoll(int devs)
{
struct adb_request req;
@@ -1037,7 +1037,7 @@ pmu_adb_autopoll(int devs)
}
/* Reset the ADB bus */
-static int __pmac
+static int
pmu_adb_reset_bus(void)
{
struct adb_request req;
@@ -1072,7 +1072,7 @@ pmu_adb_reset_bus(void)
#endif /* CONFIG_ADB */
/* Construct and send a pmu request */
-int __openfirmware
+int
pmu_request(struct adb_request *req, void (*done)(struct adb_request *),
int nbytes, ...)
{
@@ -1098,7 +1098,7 @@ pmu_request(struct adb_request *req, voi
return pmu_queue_request(req);
}
-int __pmac
+int
pmu_queue_request(struct adb_request *req)
{
unsigned long flags;
@@ -1190,7 +1190,7 @@ pmu_done(struct adb_request *req)
(*done)(req);
}
-static void __pmac
+static void
pmu_start(void)
{
struct adb_request *req;
@@ -1214,7 +1214,7 @@ pmu_start(void)
send_byte(req->data[0]);
}
-void __openfirmware
+void
pmu_poll(void)
{
if (!via)
@@ -1224,7 +1224,7 @@ pmu_poll(void)
via_pmu_interrupt(0, NULL, NULL);
}
-void __openfirmware
+void
pmu_poll_adb(void)
{
if (!via)
@@ -1239,7 +1239,7 @@ pmu_poll_adb(void)
|| req_awaiting_reply));
}
-void __openfirmware
+void
pmu_wait_complete(struct adb_request *req)
{
if (!via)
@@ -1253,7 +1253,7 @@ pmu_wait_complete(struct adb_request *re
* This is done to avoid spurrious shutdowns when we know we'll have
* interrupts switched off for a long time
*/
-void __openfirmware
+void
pmu_suspend(void)
{
unsigned long flags;
@@ -1293,7 +1293,7 @@ pmu_suspend(void)
} while (1);
}
-void __openfirmware
+void
pmu_resume(void)
{
unsigned long flags;
@@ -1323,7 +1323,7 @@ pmu_resume(void)
}
/* Interrupt data could be the result data from an ADB cmd */
-static void __pmac
+static void
pmu_handle_data(unsigned char *data, int len, struct pt_regs *regs)
{
unsigned char ints, pirq;
@@ -1435,7 +1435,7 @@ next:
goto next;
}
-static struct adb_request* __pmac
+static struct adb_request*
pmu_sr_intr(struct pt_regs *regs)
{
struct adb_request *req;
@@ -1541,7 +1541,7 @@ pmu_sr_intr(struct pt_regs *regs)
return NULL;
}
-static irqreturn_t __pmac
+static irqreturn_t
via_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
{
unsigned long flags;
@@ -1629,7 +1629,7 @@ no_free_slot:
return IRQ_RETVAL(handled);
}
-void __pmac
+void
pmu_unlock(void)
{
unsigned long flags;
@@ -1642,7 +1642,7 @@ pmu_unlock(void)
}
-static irqreturn_t __pmac
+static irqreturn_t
gpio1_interrupt(int irq, void *arg, struct pt_regs *regs)
{
unsigned long flags;
@@ -1663,12 +1663,12 @@ gpio1_interrupt(int irq, void *arg, stru
}
#ifdef CONFIG_PMAC_BACKLIGHT
-static int backlight_to_bright[] __pmacdata = {
+static int backlight_to_bright[] = {
0x7f, 0x46, 0x42, 0x3e, 0x3a, 0x36, 0x32, 0x2e,
0x2a, 0x26, 0x22, 0x1e, 0x1a, 0x16, 0x12, 0x0e
};
-static int __openfirmware
+static int
pmu_set_backlight_enable(int on, int level, void* data)
{
struct adb_request req;
@@ -1688,7 +1688,7 @@ pmu_set_backlight_enable(int on, int lev
return 0;
}
-static void __openfirmware
+static void
pmu_bright_complete(struct adb_request *req)
{
if (req == &bright_req_1)
@@ -1697,7 +1697,7 @@ pmu_bright_complete(struct adb_request *
clear_bit(2, &async_req_locks);
}
-static int __openfirmware
+static int
pmu_set_backlight_level(int level, void* data)
{
if (vias == NULL)
@@ -1717,7 +1717,7 @@ pmu_set_backlight_level(int level, void*
}
#endif /* CONFIG_PMAC_BACKLIGHT */
-void __pmac
+void
pmu_enable_irled(int on)
{
struct adb_request req;
@@ -1732,7 +1732,7 @@ pmu_enable_irled(int on)
pmu_wait_complete(&req);
}
-void __pmac
+void
pmu_restart(void)
{
struct adb_request req;
@@ -1757,7 +1757,7 @@ pmu_restart(void)
;
}
-void __pmac
+void
pmu_shutdown(void)
{
struct adb_request req;
@@ -2076,7 +2076,7 @@ pmu_unregister_sleep_notifier(struct pmu
}
/* Sleep is broadcast last-to-first */
-static int __pmac
+static int
broadcast_sleep(int when, int fallback)
{
int ret = PBOOK_SLEEP_OK;
@@ -2101,7 +2101,7 @@ broadcast_sleep(int when, int fallback)
}
/* Wake is broadcast first-to-last */
-static int __pmac
+static int
broadcast_wake(void)
{
int ret = PBOOK_SLEEP_OK;
@@ -2132,7 +2132,7 @@ static struct pci_save {
} *pbook_pci_saves;
static int pbook_npci_saves;
-static void __pmac
+static void
pbook_alloc_pci_save(void)
{
int npci;
@@ -2149,7 +2149,7 @@ pbook_alloc_pci_save(void)
pbook_npci_saves = npci;
}
-static void __pmac
+static void
pbook_free_pci_save(void)
{
if (pbook_pci_saves == NULL)
@@ -2159,7 +2159,7 @@ pbook_free_pci_save(void)
pbook_npci_saves = 0;
}
-static void __pmac
+static void
pbook_pci_save(void)
{
struct pci_save *ps = pbook_pci_saves;
@@ -2190,7 +2190,7 @@ pbook_pci_save(void)
* during boot, it will be in the pci dev list. If it's disabled at this point
* (and it will probably be), then you can't access it's config space.
*/
-static void __pmac
+static void
pbook_pci_restore(void)
{
u16 cmd;
@@ -2238,7 +2238,7 @@ pbook_pci_restore(void)
#ifdef DEBUG_SLEEP
/* N.B. This doesn't work on the 3400 */
-void __pmac
+void
pmu_blink(int n)
{
struct adb_request req;
@@ -2277,9 +2277,9 @@ pmu_blink(int n)
* Put the powerbook to sleep.
*/
-static u32 save_via[8] __pmacdata;
+static u32 save_via[8];
-static void __pmac
+static void
save_via_state(void)
{
save_via[0] = in_8(&via[ANH]);
@@ -2291,7 +2291,7 @@ save_via_state(void)
save_via[6] = in_8(&via[T1CL]);
save_via[7] = in_8(&via[T1CH]);
}
-static void __pmac
+static void
restore_via_state(void)
{
out_8(&via[ANH], save_via[0]);
@@ -2307,7 +2307,7 @@ restore_via_state(void)
out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
}
-static int __pmac
+static int
pmac_suspend_devices(void)
{
int ret;
@@ -2397,7 +2397,7 @@ pmac_suspend_devices(void)
return 0;
}
-static int __pmac
+static int
pmac_wakeup_devices(void)
{
mdelay(100);
@@ -2436,7 +2436,7 @@ pmac_wakeup_devices(void)
#define GRACKLE_NAP (1<<4)
#define GRACKLE_SLEEP (1<<3)
-int __pmac
+int
powerbook_sleep_grackle(void)
{
unsigned long save_l2cr;
@@ -2520,7 +2520,7 @@ powerbook_sleep_grackle(void)
return 0;
}
-static int __pmac
+static int
powerbook_sleep_Core99(void)
{
unsigned long save_l2cr;
@@ -2620,7 +2620,7 @@ powerbook_sleep_Core99(void)
#define PB3400_MEM_CTRL 0xf8000000
#define PB3400_MEM_CTRL_SLEEP 0x70
-static int __pmac
+static int
powerbook_sleep_3400(void)
{
int ret, i, x;
@@ -2720,9 +2720,9 @@ struct pmu_private {
};
static LIST_HEAD(all_pmu_pvt);
-static DEFINE_SPINLOCK(all_pvt_lock __pmacdata);
+static DEFINE_SPINLOCK(all_pvt_lock);
-static void __pmac
+static void
pmu_pass_intr(unsigned char *data, int len)
{
struct pmu_private *pp;
@@ -2751,7 +2751,7 @@ pmu_pass_intr(unsigned char *data, int l
spin_unlock_irqrestore(&all_pvt_lock, flags);
}
-static int __pmac
+static int
pmu_open(struct inode *inode, struct file *file)
{
struct pmu_private *pp;
@@ -2773,7 +2773,7 @@ pmu_open(struct inode *inode, struct fil
return 0;
}
-static ssize_t __pmac
+static ssize_t
pmu_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
@@ -2825,14 +2825,14 @@ pmu_read(struct file *file, char __user
return ret;
}
-static ssize_t __pmac
+static ssize_t
pmu_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
return 0;
}
-static unsigned int __pmac
+static unsigned int
pmu_fpoll(struct file *filp, poll_table *wait)
{
struct pmu_private *pp = filp->private_data;
@@ -2849,7 +2849,7 @@ pmu_fpoll(struct file *filp, poll_table
return mask;
}
-static int __pmac
+static int
pmu_release(struct inode *inode, struct file *file)
{
struct pmu_private *pp = file->private_data;
@@ -2874,8 +2874,7 @@ pmu_release(struct inode *inode, struct
return 0;
}
-/* Note: removed __openfirmware here since it causes link errors */
-static int __pmac
+static int
pmu_ioctl(struct inode * inode, struct file *filp,
u_int cmd, u_long arg)
{
@@ -2957,7 +2956,7 @@ pmu_ioctl(struct inode * inode, struct f
return error;
}
-static struct file_operations pmu_device_fops __pmacdata = {
+static struct file_operations pmu_device_fops = {
.read = pmu_read,
.write = pmu_write,
.poll = pmu_fpoll,
@@ -2966,7 +2965,7 @@ static struct file_operations pmu_device
.release = pmu_release,
};
-static struct miscdevice pmu_device __pmacdata = {
+static struct miscdevice pmu_device = {
PMU_MINOR, "pmu", &pmu_device_fops
};
@@ -2982,7 +2981,7 @@ device_initcall(pmu_device_init);
#ifdef DEBUG_SLEEP
-static inline void __pmac
+static inline void
polled_handshake(volatile unsigned char __iomem *via)
{
via[B] &= ~TREQ; eieio();
@@ -2993,7 +2992,7 @@ polled_handshake(volatile unsigned char
;
}
-static inline void __pmac
+static inline void
polled_send_byte(volatile unsigned char __iomem *via, int x)
{
via[ACR] |= SR_OUT | SR_EXT; eieio();
@@ -3001,7 +3000,7 @@ polled_send_byte(volatile unsigned char
polled_handshake(via);
}
-static inline int __pmac
+static inline int
polled_recv_byte(volatile unsigned char __iomem *via)
{
int x;
@@ -3013,7 +3012,7 @@ polled_recv_byte(volatile unsigned char
return x;
}
-int __pmac
+int
pmu_polled_request(struct adb_request *req)
{
unsigned long flags;
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -835,7 +835,7 @@ static struct pci_save {
} *pbook_pci_saves;
static int n_pbook_pci_saves;
-static inline void __openfirmware
+static inline void
pbook_pci_save(void)
{
int npci;
@@ -863,7 +863,7 @@ pbook_pci_save(void)
}
}
-static inline void __openfirmware
+static inline void
pbook_pci_restore(void)
{
u16 cmd;
@@ -902,7 +902,7 @@ pbook_pci_restore(void)
#define IRQ_ENABLE ((unsigned int *)0xf3000024)
#define MEM_CTRL ((unsigned int *)0xf8000070)
-int __openfirmware powerbook_sleep(void)
+int powerbook_sleep(void)
{
int ret, i, x;
static int save_backlight;
@@ -1001,25 +1001,24 @@ int __openfirmware powerbook_sleep(void)
/*
* Support for /dev/pmu device
*/
-static int __openfirmware pmu_open(struct inode *inode, struct file *file)
+static int pmu_open(struct inode *inode, struct file *file)
{
return 0;
}
-static ssize_t __openfirmware pmu_read(struct file *file, char *buf,
+static ssize_t pmu_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
return 0;
}
-static ssize_t __openfirmware pmu_write(struct file *file, const char *buf,
+static ssize_t pmu_write(struct file *file, const char *buf,
size_t count, loff_t *ppos)
{
return 0;
}
-/* Note: removed __openfirmware here since it causes link errors */
-static int /*__openfirmware*/ pmu_ioctl(struct inode * inode, struct file *filp,
+static int pmu_ioctl(struct inode * inode, struct file *filp,
u_int cmd, u_long arg)
{
int error;
^ permalink raw reply
* Re: PATCH powerpc: 03/04 Remove section free() and linker script bits
From: Jon Loeliger @ 2005-09-17 15:38 UTC (permalink / raw)
To: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -149,32 +149,6 @@ SECTIONS
. = ALIGN(4096);
_sextratext = .;
- __pmac_begin = .;
- .pmac.text : { *(.pmac.text) }
- .pmac.data : { *(.pmac.data) }
- . = ALIGN(4096);
- __pmac_end = .;
-
- . = ALIGN(4096);
- __prep_begin = .;
- .prep.text : { *(.prep.text) }
- .prep.data : { *(.prep.data) }
- . = ALIGN(4096);
- __prep_end = .;
-
- . = ALIGN(4096);
- __chrp_begin = .;
- .chrp.text : { *(.chrp.text) }
- .chrp.data : { *(.chrp.data) }
- . = ALIGN(4096);
- __chrp_end = .;
-
- . = ALIGN(4096);
- __openfirmware_begin = .;
- .openfirmware.text : { *(.openfirmware.text) }
- .openfirmware.data : { *(.openfirmware.data) }
- . = ALIGN(4096);
- __openfirmware_end = .;
_eextratext = .;
__bss_start = .;
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -74,10 +74,6 @@ unsigned long agp_special_page;
extern char _end[];
extern char etext[], _stext[];
extern char __init_begin, __init_end;
-extern char __prep_begin, __prep_end;
-extern char __chrp_begin, __chrp_end;
-extern char __pmac_begin, __pmac_end;
-extern char __openfirmware_begin, __openfirmware_end;
#ifdef CONFIG_HIGHMEM
pte_t *kmap_pte;
@@ -167,14 +163,6 @@ void free_initmem(void)
printk ("Freeing unused kernel memory:");
FREESEC(init);
- if (_machine != _MACH_Pmac)
- FREESEC(pmac);
- if (_machine != _MACH_chrp)
- FREESEC(chrp);
- if (_machine != _MACH_prep)
- FREESEC(prep);
- if (!have_of)
- FREESEC(openfirmware);
printk("\n");
ppc_md.progress = NULL;
#undef FREESEC
^ permalink raw reply
* Re: PATCH powerpc: 04/04 Merge simplified sections.h into asm-powerpc
From: Jon Loeliger @ 2005-09-17 15:39 UTC (permalink / raw)
To: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>
diff --git a/include/asm-powerpc/sections.h b/include/asm-powerpc/sections.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/sections.h
@@ -0,0 +1,20 @@
+#ifndef _ASM_POWERPC_SECTIONS_H
+#define _ASM_POWERPC_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#ifdef __powerpc64__
+
+extern char _end[];
+
+static inline int in_kernel_text(unsigned long addr)
+{
+ if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end)
+ return 1;
+
+ return 0;
+}
+
+#endif
+
+#endif /* _ASM_POWERPC_SECTIONS_H */
diff --git a/include/asm-ppc/sections.h b/include/asm-ppc/sections.h
deleted file mode 100644
--- a/include/asm-ppc/sections.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_SECTIONS_H
-#define _PPC_SECTIONS_H
-
-#include <asm-generic/sections.h>
-
-#define __pmac __attribute__ ((__section__ (".pmac.text")))
-#define __pmacdata __attribute__ ((__section__ (".pmac.data")))
-#define __pmacfunc(__argpmac) \
- __argpmac __pmac; \
- __argpmac
-
-#define __prep __attribute__ ((__section__ (".prep.text")))
-#define __prepdata __attribute__ ((__section__ (".prep.data")))
-#define __prepfunc(__argprep) \
- __argprep __prep; \
- __argprep
-
-#define __chrp __attribute__ ((__section__ (".chrp.text")))
-#define __chrpdata __attribute__ ((__section__ (".chrp.data")))
-#define __chrpfunc(__argchrp) \
- __argchrp __chrp; \
- __argchrp
-
-/* this is actually just common chrp/pmac code, not OF code -- Cort */
-#define __openfirmware __attribute__ ((__section__ (".openfirmware.text")))
-#define __openfirmwaredata __attribute__ ((__section__ (".openfirmware.data")))
-#define __openfirmwarefunc(__argopenfirmware) \
- __argopenfirmware __openfirmware; \
- __argopenfirmware
-
-#endif /* _PPC_SECTIONS_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/sections.h b/include/asm-ppc64/sections.h
deleted file mode 100644
--- a/include/asm-ppc64/sections.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _PPC64_SECTIONS_H
-#define _PPC64_SECTIONS_H
-
-extern char _end[];
-
-#include <asm-generic/sections.h>
-
-#define __pmac
-#define __pmacdata
-
-#define __prep
-#define __prepdata
-
-#define __chrp
-#define __chrpdata
-
-#define __openfirmware
-#define __openfirmwaredata
-
-
-static inline int in_kernel_text(unsigned long addr)
-{
- if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end)
- return 1;
-
- return 0;
-}
-
-#endif
^ permalink raw reply
* Re: Repeated corruption of file->f_ep_lock
From: David Woodhouse @ 2005-09-17 18:12 UTC (permalink / raw)
To: Paul Mackerras; +Cc: ppc-dev list, Davide Libenzi, viro
In-Reply-To: <17196.5625.322927.221055@cargo.ozlabs.ibm.com>
On Sat, 2005-09-17 at 23:11 +1000, Paul Mackerras wrote:
> They look like part of an exception stack frame.
Aha, thanks. Now... any ideas about how they're getting into struct
file? It's always at the same offset in the struct, and it's not at the
same offset in the page each time -- this is happening all over the
place.
e.g....
Sep 17 11:09:34 peach kernel: File cb789760 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 11:09:34 peach kernel: lock 24042084, owner_pc 0, owner_cpu 901
--
Sep 17 11:11:07 peach kernel: File c70038c0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 11:11:07 peach kernel: lock 24042484, owner_pc 0, owner_cpu 901
--
Sep 17 11:12:22 peach kernel: File c89c0320 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 11:12:22 peach kernel: lock 24042484, owner_pc 0, owner_cpu 901
--
Sep 17 12:02:02 peach kernel: File c90378a0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:02:02 peach kernel: lock 24022484, owner_pc 0, owner_cpu 901
--
Sep 17 12:04:57 peach kernel: File c962b3e0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:04:57 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:08:01 peach kernel: File cb245700 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:08:01 peach kernel: lock 24042884, owner_pc 0, owner_cpu 901
--
Sep 17 12:11:00 peach kernel: File c64e5aa0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:11:00 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:13:15 peach kernel: File c0a1eac0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:13:15 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:21:44 peach kernel: File caeb3360 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:21:44 peach kernel: lock 24042084, owner_pc 0, owner_cpu 901
--
Sep 17 12:24:25 peach kernel: File caeb3d60 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:24:25 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:25:08 peach kernel: File c6b24300 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:25:08 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:25:09 peach kernel: File ca6465c0 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:25:09 peach kernel: lock 24022484, owner_pc 0, owner_cpu 901
--
Sep 17 12:26:59 peach kernel: File c9037c60 (fops d107c980) has corrupted f_epoll_lock!
Sep 17 12:26:59 peach kernel: lock 28000484, owner_pc 0, owner_cpu 901
--
Sep 17 12:29:55 peach kernel: File ca64b120 (fops c031f44c) has corrupted f_epoll_lock!
Sep 17 12:29:55 peach kernel: lock 20000484, owner_pc 0, owner_cpu 901
--
dwmw2
^ permalink raw reply
* Re: Reminder: removal of APUS and Gemini still pending
From: Roman Zippel @ 2005-09-17 19:48 UTC (permalink / raw)
To: Kumar Gala; +Cc: ppc-dev list
In-Reply-To: <15A1D026-00E3-4652-ABA5-9A8B8517A2CA@freescale.com>
Hi,
Kumar Gala wrote:
> This is a reminder email to all those that care that APUS and Gemini
> configs are still not building in the kernel. They are still scheduled
> to be removed after the release of 2.6.15.
Regarding APUS: with the current rate of changes I simply don't have the
time to catch up right now. What's the game plan here? If I miss the
deadline, I have to start from scratch?
bye, Roman
^ permalink raw reply
* Re: PATCH powerpc: 00/04 Remove __pmac, etc, sections, merge sections.h
From: Benjamin Herrenschmidt @ 2005-09-18 1:25 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>
On Sat, 2005-09-17 at 10:31 -0500, Jon Loeliger wrote:
> Here is a new patch that removes all notion of the pmac, prep,
> chrp and openfirmware initialization sections, and then unifies
> the sections.h files without those __pmac, etc, sections identifiers
> cluttering things up.
When did we decide to do that ? Some people are still using ppc machines
with rather small memory footprint (old ones), it's handy to get rid of
the code you don't need... It would make sense if we could compile
CHRP/PMAC/PREP in/out (like we can do with platforms on ppc64) so that
people who have tight memory requirements can build a PReP or CHRP
kernel without all of the pmac code.
Ben.
^ permalink raw reply
* Re: Repeated corruption of file->f_ep_lock
From: Benjamin Herrenschmidt @ 2005-09-18 1:23 UTC (permalink / raw)
To: Paul Mackerras; +Cc: ppc-dev list, David Woodhouse, Davide Libenzi, viro
In-Reply-To: <17196.5625.322927.221055@cargo.ozlabs.ibm.com>
On Sat, 2005-09-17 at 23:11 +1000, Paul Mackerras wrote:
> David Woodhouse writes:
>
> > The previous and next members of 'struct file', which are f_ep_list and
> > f_mapping respectively, are always fine. It's just f_ep_lock which is
> > scribbled upon, and the scribble is fairly repeatable: 'owner_cpu' is
> > almost always set to 0x901 but occasionally 0x501, and the 'lock' field
> > has values like 20282484, 24042884, 28022484, 24042084, 22000424 (hex).
> > Do those numbers seem meaningful to anyone? Any clues as to where they
> > might be coming from?
>
> They look like part of an exception stack frame. The 901 or 501 would
> be the trap number; 500 for an external interrupt or 900 for a
> decrementer interrupt, plus 1 which we use as a marker to say that
> only the volatile registers have been saved in the frame. The other
> values (20282484 etc.) could possibly be condition register values.
> That would fit with owner_cpu being 2 words past the lock field; the
> trap field in struct pt_regs is 2 words past the ccr field.
kernel stack overflow ? Also, you could try using the DABR (Data Access
Breakpoint) if any on your CPU to try to catch at the instant of the
corruption...
Ben.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox