aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-12 16:19:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-12 17:11:35 -0400
commit9aa7a7d5daa7e33d7e7656bffe76af67c1bf56d2 (patch)
treeb68726c758a02316c0e42dd934d4e1b789ad034b
parentf993004d73f266a02f3ac736fafb033c600972d9 (diff)
alpha: unbreak percpu again
Commit 9b8de7479d0dbab1ed98b5b015d44232c9d3d08e ("FRV: Fix the section attribute on UP DECLARE_PER_CPU()") cleaned up DECLARE/DEFINE_PER_CPU() macros and in the process made alpha percpu.h include include/asm-generic/percpu.h which breaks compilation due to duplicate definitions. Remove inclusion of generic asm helper file and define whatever necessary in alpha header proper. In the longer term, percpu definitions will be unified and all these little subtlties will be removed. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: David Howells <dhowells@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/alpha/include/asm/percpu.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h
index e9e0bb5a23bf..06c5c7a4afd3 100644
--- a/arch/alpha/include/asm/percpu.h
+++ b/arch/alpha/include/asm/percpu.h
@@ -1,7 +1,9 @@
1#ifndef __ALPHA_PERCPU_H 1#ifndef __ALPHA_PERCPU_H
2#define __ALPHA_PERCPU_H 2#define __ALPHA_PERCPU_H
3
3#include <linux/compiler.h> 4#include <linux/compiler.h>
4#include <linux/threads.h> 5#include <linux/threads.h>
6#include <linux/percpu-defs.h>
5 7
6/* 8/*
7 * Determine the real variable name from the name visible in the 9 * Determine the real variable name from the name visible in the
@@ -73,6 +75,28 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
73 75
74#endif /* SMP */ 76#endif /* SMP */
75 77
76#include <asm-generic/percpu.h> 78#ifdef CONFIG_SMP
79#define PER_CPU_BASE_SECTION ".data.percpu"
80#else
81#define PER_CPU_BASE_SECTION ".data"
82#endif
83
84#ifdef CONFIG_SMP
85
86#ifdef MODULE
87#define PER_CPU_SHARED_ALIGNED_SECTION ""
88#else
89#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
90#endif
91#define PER_CPU_FIRST_SECTION ".first"
92
93#else
94
95#define PER_CPU_SHARED_ALIGNED_SECTION ""
96#define PER_CPU_FIRST_SECTION ""
97
98#endif
99
100#define PER_CPU_ATTRIBUTES
77 101
78#endif /* __ALPHA_PERCPU_H */ 102#endif /* __ALPHA_PERCPU_H */
n> 0x05, 0x078B); mix_write(new_mode, 0x078B); mode_control = new_mode; } static int pas_mixer_set(int whichDev, unsigned int level) { int left, right, devmask, changed, i, mixer = 0; DEB(printk("static int pas_mixer_set(int whichDev = %d, unsigned int level = %X)\n", whichDev, level)); left = level & 0x7f; right = (level & 0x7f00) >> 8; if (whichDev < SOUND_MIXER_NRDEVICES) { if ((1 << whichDev) & rec_devices) mixer = 0x20; else mixer = 0x00; } switch (whichDev) { case SOUND_MIXER_VOLUME: /* Master volume (0-63) */ levels[whichDev] = mixer_output(right, left, 63, 0x01, 0); break; /* * Note! Bass and Treble are mono devices. Will use just the left * channel. */ case SOUND_MIXER_BASS: /* Bass (0-12) */ levels[whichDev] = mixer_output(right, left, 12, 0x03, 0); break; case SOUND_MIXER_TREBLE: /* Treble (0-12) */ levels[whichDev] = mixer_output(right, left, 12, 0x04, 0); break; case SOUND_MIXER_SYNTH: /* Internal synthesizer (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x00, mixer); break; case SOUND_MIXER_PCM: /* PAS PCM (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x05, mixer); break; case SOUND_MIXER_ALTPCM: /* SB PCM (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x07, mixer); break; case SOUND_MIXER_SPEAKER: /* PC speaker (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x06, mixer); break; case SOUND_MIXER_LINE: /* External line (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x02, mixer); break; case SOUND_MIXER_CD: /* CD (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x03, mixer); break; case SOUND_MIXER_MIC: /* External microphone (0-31) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x04, mixer); break; case SOUND_MIXER_IMIX: /* Recording monitor (0-31) (Output mixer only) */ levels[whichDev] = mixer_output(right, left, 31, 0x10 | 0x01, 0x00); break; case SOUND_MIXER_RECLEV: /* Recording level (0-15) */ levels[whichDev] = mixer_output(right, left, 15, 0x02, 0); break; case SOUND_MIXER_RECSRC: devmask = level & POSSIBLE_RECORDING_DEVICES; changed = devmask ^ rec_devices; rec_devices = devmask; for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) if (changed & (1 << i)) { pas_mixer_set(i, levels[i]); } return rec_devices; break; default: return -EINVAL; } return (levels[whichDev]); } /*****/ static void pas_mixer_reset(void) { int foo; DEB(printk("pas2_mixer.c: void pas_mixer_reset(void)\n")); for (foo = 0; foo < SOUND_MIXER_NRDEVICES; foo++) pas_mixer_set(foo, levels[foo]); set_mode(0x04 | 0x01); } static int pas_mixer_ioctl(int dev, unsigned int cmd, void __user *arg) { int level,v ; int __user *p = (int __user *)arg; DEB(printk("pas2_mixer.c: int pas_mixer_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg)); if (cmd == SOUND_MIXER_PRIVATE1) { /* Set loudness bit */ if (get_user(level, p)) return -EFAULT; if (level == -1) /* Return current settings */ level = (mode_control & 0x04); else { mode_control &= ~0x04; if (level) mode_control |= 0x04; set_mode(mode_control); } level = !!level; return put_user(level, p); } if (cmd == SOUND_MIXER_PRIVATE2) { /* Set enhance bit */ if (get_user(level, p)) return -EFAULT; if (level == -1) { /* Return current settings */ if (!(mode_control & 0x03)) level = 0; else level = ((mode_control & 0x03) + 1) * 20; } else { int i = 0; level &= 0x7f; if (level) i = (level / 20) - 1; mode_control &= ~0x03; mode_control |= i & 0x03; set_mode(mode_control); if (i) i = (i + 1) * 20; level = i; } return put_user(level, p); } if (cmd == SOUND_MIXER_PRIVATE3) { /* Set mute bit */ if (get_user(level, p)) return -EFAULT; if (level == -1) /* Return current settings */ level = !(pas_read(0x0B8A) & 0x20); else { if (level) pas_write(pas_read(0x0B8A) & (~0x20), 0x0B8A); else pas_write(pas_read(0x0B8A) | 0x20, 0x0B8A); level = !(pas_read(0x0B8A) & 0x20); } return put_user(level, p); } if (((cmd >> 8) & 0xff) == 'M') { if (get_user(v, p)) return -EFAULT; if (_SIOC_DIR(cmd) & _SIOC_WRITE) { v = pas_mixer_set(cmd & 0xff, v); } else { switch (cmd & 0xff) { case SOUND_MIXER_RECSRC: v = rec_devices; break; case SOUND_MIXER_STEREODEVS: v = SUPPORTED_MIXER_DEVICES & ~(SOUND_MASK_BASS | SOUND_MASK_TREBLE); break; case SOUND_MIXER_DEVMASK: v = SUPPORTED_MIXER_DEVICES; break; case SOUND_MIXER_RECMASK: v = POSSIBLE_RECORDING_DEVICES & SUPPORTED_MIXER_DEVICES; break; case SOUND_MIXER_CAPS: v = 0; /* No special capabilities */ break; default: v = levels[cmd & 0xff]; break; } } return put_user(v, p); } return -EINVAL; } static struct mixer_operations pas_mixer_operations = { .owner = THIS_MODULE, .id = "PAS16", .name = "Pro Audio Spectrum 16", .ioctl = pas_mixer_ioctl }; int __init pas_init_mixer(void) { int d; levels = load_mixer_volumes("PAS16_1", default_levels, 1); pas_mixer_reset(); if ((d = sound_alloc_mixerdev()) != -1) { audio_devs[pas_audiodev]->mixer_dev = d; mixer_devs[d] = &pas_mixer_operations; } return 1; }