Commit 7846fcff authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk

into home.transmeta.com:/home/torvalds/v2.5/linux
parents b4357f99 c9c39357
00-INDEX
- this file
Booting
- requirements for booting
Interrupts
- ARM Interrupt subsystem documentation
Netwinder
- Netwinder specific documentation
README
- General ARM documentation
SA1100
- SA1100 documentation
XScale
- XScale documentation
empeg
- Empeg documentation
mem_alignment
- alignment abort handler documentation
nwfpe
- NWFPE floating point emulator documentation
Booting ARM Linux
=================
Author: Russell King
Date : 18 May 2002
The following documentation is relevant to 2.4.18-rmk6 and beyond.
In order to boot ARM Linux, you require a boot loader, which is a small
program that runs before the main kernel. The boot loader is expected
to initialise various devices, and eventually call the Linux kernel,
passing information to the kernel.
Essentially, the boot loader should provide (as a minimum) the
following:
1. Setup and initialise the RAM.
2. Initialise one serial port.
3. Detect the machine type.
4. Setup the kernel tagged list.
5. Call the kernel image.
1. Setup and initialise RAM
---------------------------
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
The boot loader is expected to find and initialise all RAM that the
kernel will use for volatile data storage in the system. It performs
this in a machine dependent manner. (It may use internal algorithms
to automatically locate and size all RAM, or it may use knowledge of
the RAM in the machine, or any other method the boot loader designer
sees fit.)
2. Initialise one serial port
-----------------------------
Existing boot loaders: OPTIONAL, RECOMMENDED
New boot loaders: OPTIONAL, RECOMMENDED
The boot loader should initialise and enable one serial port on the
target. This allows the kernel serial driver to automatically detect
which serial port it should use for the kernel console (generally
used for debugging purposes, or communication with the target.)
As an alternative, the boot loader can pass the relevant 'console='
option to the kernel via the tagged lists specifing the port, and
serial format options as described in
linux/Documentation/kernel-parameters.txt.
3. Detect the machine type
--------------------------
Existing boot loaders: OPTIONAL
New boot loaders: MANDATORY
The boot loader should detect the machine type its running on by some
method. Whether this is a hard coded value or some algorithm that
looks at the connected hardware is beyond the scope of this document.
The boot loader must ultimately be able to provide a MACH_TYPE_xxx
value to the kernel. (see linux/arch/arm/tools/mach-types).
4. Setup the kernel tagged list
-------------------------------
Existing boot loaders: OPTIONAL, HIGHLY RECOMMENDED
New boot loaders: MANDATORY
The boot loader must create and initialise the kernel tagged list.
A valid tagged list starts with ATAG_CORE and ends with ATAG_NONE.
The ATAG_CORE tag may or may not be empty. An empty ATAG_CORE tag
has the size field set to '2' (0x00000002). The ATAG_NONE must set
the size field to zero.
Any number of tags can be placed in the list. It is undefined
whether a repeated tag appends to the information carried by the
previous tag, or whether it replaces the information in its
entirety; some tags behave as the former, others the latter.
The boot loader must pass at a minimum the size and location of
the system memory, and root filesystem location. Therefore, the
minimum tagged list should look:
+-----------+
base -> | ATAG_CORE | |
+-----------+ |
| ATAG_MEM | | increasing address
+-----------+ |
| ATAG_NONE | |
+-----------+ v
The tagged list should be stored in system RAM.
The tagged list must be placed in a region of memory where neither
the kernel decompressor nor initrd 'bootp' program will overwrite
it. The recommended placement is in the first 16KiB of RAM.
5. Calling the kernel image
---------------------------
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
There are two options for calling the kernel zImage. If the zImage
is stored in flash, and is linked correctly to be run from flash,
then it is legal for the boot loader to call the zImage in flash
directly.
The zImage may also be placed in system RAM (at any location) and
called there. Note that the kernel uses 16K of RAM below the image
to store page tables. The recommended placement is 32KiB into RAM.
In either case, the following conditions must be met:
- CPU register settings
r0 = 0,
r1 = machine type number discovered in (3) above.
r2 = physical address of tagged list in system RAM.
- CPU mode
All forms of interrupts must be disabled (IRQs and FIQs)
The CPU must be in SVC mode. (A special exception exists for Angel)
- Caches, MMUs
The MMU must be off.
Instruction cache may be on or off.
Data cache must be off.
- The boot loader is expected to call the kernel image by jumping
directly to the first instruction of the kernel image.
Support functions for the SA11x0 internal DMA channels
======================================================
Nicolas Pitre <nico@cam.org>
Last updated: 2001/07/15
The DMA controller consists of six independent DMA channels. Each channel
can be configured to service any of the serial controllers. Two channels
are required to service a full-duplex serial controller. The DMA
controller is intended to relieve the processor of the interrupt overhead
in servicing these ports with programmed I/ O.
If desired, any or all peripherals (except the UDC) may be serviced with
programmed I/ O instead of DMA. Each peripheral is capable of requesting
processor service through its own interrupt lines or through a DMA
request.
A set of functions is provided to support drivers working with DMA buffers
through a generic interface for (wishfully) all DMA usages. Those
functions will take care of buffer queueing and splitting, DMA register
management, interrupt handling, etc.
SA11x0 DMA API
--------------
Here is the description for the DMA API.
int sa1100_request_dma( dmach_t *channel, const char *device_id,
dma_device_t device );
This function will search for a free DMA channel and returns the channel
number in '*channel'. 'device_id' should point to a string identifying
the DMA usage or device (mainly for /proc). 'device' is the SA11x0
peripheral's ports. Note that reading from a port and writing to the
same port are actually considered as two different streams requiring
two DMA channels with their own device type. All possible dma_device_t
are defined in include/asm-arm/arch-sa1100/dma.h. If no channel is
available, or if the desired device is already in use by another DMA
channel, then an error code is returned. This function must be called
before any other DMA calls.
int sa1100_dma_queue_buffer( dmach_t channel, void *buf_id,
dma_addr_t data, int size );
This function enqueue the specified buffer for DMA processing. The buffer
will be transmitted or filled with incoming data depending on the channel
configuration made through sa1100_dma_set_device(). If the queue is
empty, DMA starts immediately on the given buffer.
Arguments are:
dmach_t channel: the channel number.
void *buf_id: a buffer identification known by the caller.
dma_addr_t data: the buffer's physical address.
int size: the buffer size in bytes.
Note here the dma_addr_t which is not the same as the virtual address as
returned by kmalloc() and friends. The DMA controller must be given a
physical address to a buffer which is not cached bye the CPU data cache.
To get such address, the DMA mapping functions (see
Documentation/DMA-mapping.txt) are recommended. The only relevant
functions are pci_alloc_consistent(), pci_map_single() and their unmap
counterparts. The PCI dev argument is NULL of course.
There is no restriction on the buffer size. The DMA code will split it up
internally to acommodate the DMA controller as needed. If the buffer
can't be enqueued the appropriate error code is returned.
int sa1100_dma_set_callback( dmach_t channel, dma_callback_t cb );
As soon as the DMa completes with a buffer, a callback function is used to
notify the driver which would have registered one. The callback function
is prototyped as:
void dma_callback( void *buf_id, int size );
The 'buf_id' argument is the buffer identifier as passed to
sa1100_dma_queue_buffer(). The 'size' argument is the number of bytes the
DMA processed (should be the same as the buffer size).
Note that this callback function is called while in interrupt context.
So it has to be small and efficient while posponing more complex
processing to a bottom-half function or similar. All
restrictions for interrupt handlers still apply.
int sa1100_dma_get_current( dmach_t channel, void **buf_id,
dma_addr_t *addr );
This returns the buffer ID and the DMA address pointer within the buffer
currently being processed. If no such buffer is currently processed, an
error code is returned. This is useful for mmap()'ed buffers like in
audio drivers.
int sa1100_dma_stop( dmach_t channel );
This call stops any DMA transfer on the given channel.
int sa1100_dma_resume( dmach_t channel );
This call resumes a DMA transfer which would have been stopped through
sa1100_dma_stop().
int sa1100_dma_flush_all( dmach_t channel );
This completely flushes all queued buffers and on-going DMA transfers on a
given channel. The next enqueued buffer following this call will be
processed right away.
int sa1100_dma_set_spin( dmach_t channel, dma_addr_t addr, int size );
Because there is at least one device out there that uses its receive
signal for its transmit clock reference, we need a mecanism to make the
DMA "spin" on a certain buffer for when there is no more actual buffer to
process. The 'addr' argument is the physical memory address to use, and
the 'size' argument determines the spin DMA chunk. This size can't be
larger than 8191 (if so, it is clamped to 4096). When the size is 0,
the spin function is turned off.
When activated, DMA will "spin" until there is any buffer in the queue.
The current DMA chunk will terminate before a newly queued buffer is
processed. The spin buffer will only be reused when there is no more
acctual buffer to process.
It is important not to choose a too small 'size' value since it will
greatly increase the interrupt load required to restart the spin. Since
this feature will typically be used on transmit DMAs, and because a buffer
full of zeros is probably the best thing to spin out, the 'addr' argument
may well be used with FLUSH_BASE_PHYS for which no allocation nor memory
bus request are needed.
The spinning DMA is affected by sa1100_dma_stop() and sa1100_dma_resume()
but not bu sa1100_dma_flush_all().
void sa1100_free_dma( dmach_t channel );
This clears all activities on a given DMA channel and releases it for
future requests.
Buffer allocation
-----------------
Like mentionned above, it is the driver's responsibility to allocate, free
and keep track of buffer space with dma_addr_t type addresses. However the
driver must not change the state of any buffer after it has been sent to
sa1100-dma_queue_buffer(). When that function has been called, the buffer
becomes the DMA's ownership until one of these events occur:
- The callback function is called by the DMA code with a buffer ID to
indicate that DMA processing terminated on that buffer. Then the
driver owns the buffer again.
- The sa1100-dma_flush_all() function is called by the driver at which
point *all* queued buffers are owned by the driver again.
- The sa1100-free_dma() does the same as sa1100-dma_flush_all().
This doesn't mean that you can't change the content of a queued buffer in
conjonction with the usage of pci_map_consistent() and
sa1100_dma_get_current()... but then you must be sure you know what you're
doing (this doesn't work with pci_map_single()).
Examples
--------
A real example of audio ring buffers is implemented in the
drivers/sound/sa1100-audio.c driver. The SA1110 USB client and the
SA11x0 FIR drivers are also using this interface to implement packetized
DMA.
A transmit DMA for network packets could look like this (largely simplified):
struct sk_buff *tx_ring_skb[RING_SIZE];
dma_addr_t tx_ring_dma[RING_SIZE];
int cur_tx;
...
transmit function:
tx_ring_skb[cur_tx] = skb;
tx_ring_dma[cur_tx] = pci_map_single(NULL, skb->data, skb->len,
PCI_DMA_TODEVICE);
sa1100_dma_queue_buffer(channel, (void*)cur_tx,
tx_ring_dma[cur_tx], skb->len);
cur_tx++; cur_tx %= RING_SIZE;
...
and the callback function:
void tx_done_callback( void *buf_id, int size ) {
int done_tx = (int) buf_id;
struct sk_buff *skb = tx_ring_skb[done_tx];
pci_unmap_single(NULL, tx_ring_dma[done_tx], skb->len,
PCI_DMA_TODEVICE);
stats.tx_packets++;
stats.tx_bytes += size;
dev_kfree_skb_irq(skb);
tx_ring_skb[done_tx] = NULL;
}
For drivers expecting variable length packets i.e. USB client, it is
necessary to register the appropriate IRQ to be notified when the receiver
is idle, the packet is complete, etc. We could use one buffer at a time
with its ID being the virtual address of the buffer.
Then the sequence:
/* be sure DMA won't continue under our feet */
sa1100_dma_stop(channel);
/* get the actual DMA length */
sa1100_get_current(channel, &data, &dma_ptr);
/* acquire ownership for the buffer */
sa1100_dma_flush_all(channel);
/* unmap the DMA buffer (actually doing cache coherency on ARM) */
pci_unmap_single (NULL, dma_addr, MAX_PKT_SIZE, PCI_DMA_FROMDEVICE);
/* get remaining bytes from the fifo */
ptr = data + dma_ptr - dma_addr;
while (fifo_not_empty)
*ptr++ = get_byte_from_fifo;
/* feed another free buffer for the next packet */
dma_addr2 = pci_map_single(NULL, data2, MAX_PKT_SIZE,
PCI_DMA_FROMDEVICE);
sa1100_dma_queue_buffer(channel, data2, dma_addr2, MAX_PKT_SIZE);
/* process the current packet */
...
might do the trick. This looks a bit ugly but that's a starting point for
improvements.
TODO
----
- Create kernel-doc comments in the source to document the API and
let the documentation be generated automatically.
......@@ -366,9 +366,12 @@ __armv4_cache_on:
mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
mrc p15, 0, r0, c1, c0, 0 @ read control reg
orr r0, r0, #0x1000 @ I-cache enable
orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement
orr r0, r0, #0x0030
b __common_cache_on
bl __common_cache_on
mov r0, #0
mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs
mov pc, r12
__arm6_cache_on:
mov r12, lr
......@@ -377,6 +380,11 @@ __arm6_cache_on:
mcr p15, 0, r0, c7, c0, 0 @ invalidate whole cache v3
mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
mov r0, #0x30
bl __common_cache_on
mov r0, #0
mcr p15, 0, r0, c5, c0, 0 @ invalidate whole TLB v3
mov pc, r12
__common_cache_on:
#ifndef DEBUG
orr r0, r0, #0x000d @ Write buffer, mmu
......@@ -385,7 +393,7 @@ __common_cache_on:
mcr p15, 0, r3, c2, c0, 0 @ load page table pointer
mcr p15, 0, r1, c3, c0, 0 @ load domain access control
mcr p15, 0, r0, c1, c0, 0 @ load control register
mov pc, r12
mov pc, lr
/*
* All code following this line is relocatable. It is relocated by
......@@ -567,11 +575,12 @@ cache_clean_flush:
__armv4_cache_flush:
bic r1, pc, #31
add r2, r1, #65536 @ 2x the largest dcache size
1: ldr r12, [r1], #32 @ s/w flush D cache
1: ldr r3, [r1], #32 @ s/w flush D cache
teq r1, r2
bne 1b
mcr p15, 0, r1, c7, c7, 0 @ flush I cache
mcr p15, 0, r1, c7, c5, 0 @ flush I cache
mcr p15, 0, r1, c7, c6, 0 @ flush D cache
mcr p15, 0, r1, c7, c10, 4 @ drain WB
mov pc, lr
......
......@@ -978,6 +978,8 @@ ecard_probe(int slot, card_type_t type)
strcpy(ec->dev.name, "fixme!");
ec->dev.parent = NULL;
ec->dev.bus = &ecard_bus_type;
ec->dev.dma_mask = &ec->dma_mask;
ec->dma_mask = (u64)0xffffffff;
device_register(&ec->dev);
......
......@@ -81,7 +81,7 @@ unsigned long phys_initrd_start __initdata = 0;
unsigned long phys_initrd_size __initdata = 0;
static struct meminfo meminfo __initdata = { 0, };
static struct proc_info_item proc_info;
static const char *cpu_name;
static const char *machine_name;
static char command_line[COMMAND_LINE_SIZE];
......@@ -275,7 +275,7 @@ static void __init setup_processor(void)
while (1);
}
proc_info = *list->info;
cpu_name = list->cpu_name;
#ifdef MULTI_CPU
processor = *list->proc;
......@@ -287,9 +287,9 @@ static void __init setup_processor(void)
cpu_user = *list->user;
#endif
printk("CPU: %s %s revision %d (ARMv%s)\n",
proc_info.manufacturer, proc_info.cpu_name,
(int)processor_id & 15, proc_arch[cpu_architecture()]);
printk("CPU: %s [%08x] revision %d (ARMv%s)\n",
cpu_name, processor_id, (int)processor_id & 15,
proc_arch[cpu_architecture()]);
dump_cpu_info();
......@@ -723,9 +723,8 @@ static int c_show(struct seq_file *m, void *v)
{
int i;
seq_printf(m, "Processor\t: %s %s rev %d (%s)\n",
proc_info.manufacturer, proc_info.cpu_name,
(int)processor_id & 15, elf_platform);
seq_printf(m, "Processor\t: %s rev %d (%s)\n",
cpu_name, (int)processor_id & 15, elf_platform);
seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
loops_per_jiffy / (500000/HZ),
......
......@@ -97,11 +97,19 @@ static int integrator_verify_speed(struct cpufreq_policy *policy)
return 0;
}
static void do_set_policy(int cpu, struct cpufreq_policy *policy)
static int integrator_set_policy(struct cpufreq_policy *policy)
{
struct vco vco = freq_to_vco(policy->max, 1);
unsigned long cpus_allowed;
int cpu = policy->cpu;
struct vco vco;
struct cpufreq_freqs freqs;
u_int cm_osc;
/*
* Save this threads cpus_allowed mask.
*/
cpus_allowed = current->cpus_allowed;
/*
* Bind to the specified CPU. When this call returns,
* we should be running on the right CPU.
......@@ -109,6 +117,23 @@ static void do_set_policy(int cpu, struct cpufreq_policy *policy)
set_cpus_allowed(current, 1 << cpu);
BUG_ON(cpu != smp_processor_id());
/* get current setting */
cm_osc = __raw_readl(CM_OSC);
vco.od = (cm_osc >> 8) & 7;
vco.vdw = cm_osc & 255;
freqs.old = vco_to_freq(vco, 1);
freqs.new = target_freq;
freqs.cpu = policy->cpu;
if (freqs.old == freqs.new) {
set_cpus_allowed(current, cpus_allowed);
return 0;
}
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
vco = freq_to_vco(policy->max, 1);
cm_osc = __raw_readl(CM_OSC);
cm_osc &= 0xfffff800;
cm_osc |= vco.vdw | vco.od << 8;
......@@ -116,32 +141,14 @@ static void do_set_policy(int cpu, struct cpufreq_policy *policy)
__raw_writel(0xa05f, CM_LOCK);
__raw_writel(cm_osc, CM_OSC);
__raw_writel(0, CM_LOCK);
}
static int integrator_set_policy(struct cpufreq_policy *policy)
{
unsigned long cpus_allowed;
int cpu;
/*
* Save this threads cpus_allowed mask.
*/
cpus_allowed = current->cpus_allowed;
if (policy->cpu == CPUFREQ_ALL_CPUS) {
for (cpu = 0; cpu < NR_CPUS; cpu++) {
if (!cpu_online(cpu))
continue;
do_set_policy(cpu, policy);
}
} else
do_set_policy(policy->cpu, policy);
/*
* Restore the CPUs allowed mask.
*/
set_cpus_allowed(current, cpus_allowed);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
......@@ -149,8 +156,8 @@ static struct cpufreq_policy integrator_policy = {
.cpu = 0,
.policy = CPUFREQ_POLICY_POWERSAVE,
.cpuinfo = {
.max_cpu_freq = 160000,
.min_cpu_freq = 12000,
.max_freq = 160000,
.min_freq = 12000,
.transition_latency = CPUFREQ_ETERNAL,
},
};
......@@ -168,7 +175,7 @@ static int __init integrator_cpu_init(void)
unsigned long cpus_allowed;
int cpu;
policies = kmalloc(sizeof(struct cpufreq_freqs) * NR_CPUS,
policies = kmalloc(sizeof(struct cpufreq_policy) * NR_CPUS,
GFP_KERNEL);
if (!policies) {
printk(KERN_ERR "CPU: unable to allocate policies structure\n");
......
......@@ -183,7 +183,7 @@ static int sa1100_setspeed(struct cpufreq_policy *policy)
freqs.old = cur;
freqs.new = policy->max;
freqs.cpu = CPUFREQ_ALL_CPUS;
freqs.cpu = 0;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
......@@ -242,7 +242,7 @@ static int sa1110_setspeed(struct cpufreq_policy *policy)
freqs.old = sa11x0_getspeed();
freqs.new = policy->max;
freqs.cpu = CPUFREQ_ALL_CPUS;
freqs.cpu = 0;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
This diff is collapsed.
/*
* linux/arch/arm/mm/extable.c
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
extern const struct exception_table_entry __start___ex_table[];
extern const struct exception_table_entry __stop___ex_table[];
static inline unsigned long
search_one_table(const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long value)
const struct exception_table_entry *
search_extable(const struct exception_table_entry *first,
const struct exception_table_entry *last,
unsigned long value)
{
while (first <= last) {
const struct exception_table_entry *mid;
......@@ -22,44 +16,11 @@ search_one_table(const struct exception_table_entry *first,
mid = (last - first) / 2 + first;
diff = mid->insn - value;
if (diff == 0)
return mid->fixup;
return mid;
else if (diff < 0)
first = mid+1;
else
last = mid-1;
}
return 0;
}
extern spinlock_t modlist_lock;
unsigned long
search_exception_table(unsigned long addr)
{
unsigned long ret;
#ifndef CONFIG_MODULES
/* There is only the kernel to search. */
ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr);
#else
unsigned long flags;
struct list_head *l;
ret = 0;
/* The kernel is the last "module" -- no need to treat it special. */
spin_lock_irqsave(&modlist_lock, flags);
list_for_each(l, &extables) {
struct exception_table *ex
= list_entry(l, struct exception_table, list);
if (ex->num_entries == 0)
continue;
ret = search_one_table(ex->entry,
ex->entry + ex->num_entries - 1, addr);
if (ret)
break;
}
spin_unlock_irqrestore(&modlist_lock, flags);
#endif
return ret;
return NULL;
}
......@@ -9,6 +9,7 @@
* published by the Free Software Foundation.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -102,23 +103,25 @@ static void
__do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
struct pt_regs *regs)
{
unsigned long fixup;
const struct exception_table_entry *fixup;
/*
* Are we prepared to handle this kernel fault?
*/
if ((fixup = search_exception_table(instruction_pointer(regs))) != 0) {
fixup = search_exception_tables(instruction_pointer(regs));
if (fixup) {
#ifdef DEBUG
printk(KERN_DEBUG "%s: Exception at [<%lx>] addr=%lx (fixup: %lx)\n",
current->comm, regs->ARM_pc, addr, fixup);
current->comm, regs->ARM_pc, addr, fixup->fixup);
#endif
regs->ARM_pc = fixup;
regs->ARM_pc = fixup->fixup;
return;
}
/*
* No handler, we'll have to terminate things with extreme prejudice.
*/
bust_spinlocks(1);
printk(KERN_ALERT
"Unable to handle kernel %s at virtual address %08lx\n",
(addr < PAGE_SIZE) ? "NULL pointer dereference" :
......@@ -126,6 +129,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
show_pte(mm, addr);
die("Oops", regs, fsr);
bust_spinlocks(0);
do_exit(SIGKILL);
}
......
......@@ -420,8 +420,6 @@ ENTRY(cpu_arm1020_set_pte)
mov pc, lr
cpu_manu_name:
.asciz "ARM/VLSI"
ENTRY(cpu_arm1020_name)
.ascii "Arm1020"
#ifndef CONFIG_CPU_ICACHE_DISABLE
......@@ -518,15 +516,9 @@ arm1020_processor_functions:
.size arm1020_processor_functions, . - arm1020_processor_functions
.type cpu_arm1020_info, #object
cpu_arm1020_info:
.long cpu_manu_name
.long cpu_arm1020_name
.size cpu_arm1020_info, . - cpu_arm1020_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
.asciz "armv4t"
.size cpu_arch_name, . - cpu_arch_name
.type cpu_elf_name, #object
......@@ -546,7 +538,7 @@ __arm1020_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
.long cpu_arm1020_info
.long cpu_arm1020_name
.long arm1020_processor_functions
.long v4wbi_tlb_fns
.long v4wb_user_fns
......
......@@ -276,10 +276,12 @@ _arm3_xchg_4: swp r0, r0, [r1]
_arm2_3_check_bugs:
bics pc, lr, #0x04000000 @ Clear FIQ disable bit
armvlsi_name: .asciz "ARM/VLSI"
_arm2_name: .asciz "ARM 2"
_arm250_name: .asciz "ARM 250"
_arm3_name: .asciz "ARM 3"
cpu_arm2_name:
.asciz "ARM 2"
cpu_arm250_name:
.asciz "ARM 250"
cpu_arm3_name:
.asciz "ARM 3"
__INIT
/*
......@@ -295,10 +297,6 @@ arm2_processor_functions:
.word _arm2_xchg_1
.word _arm2_xchg_4
cpu_arm2_info:
.long armvlsi_name
.long _arm2_name
.globl arm250_processor_functions
arm250_processor_functions:
.word _arm2_3_check_bugs
......@@ -308,10 +306,6 @@ arm250_processor_functions:
.word _arm3_xchg_1
.word _arm3_xchg_4
cpu_arm250_info:
.long armvlsi_name
.long _arm250_name
.globl arm3_processor_functions
arm3_processor_functions:
.word _arm2_3_check_bugs
......@@ -321,10 +315,6 @@ arm3_processor_functions:
.word _arm3_xchg_1
.word _arm3_xchg_4
cpu_arm3_info:
.long armvlsi_name
.long _arm3_name
arm2_arch_name: .asciz "armv1"
arm3_arch_name: .asciz "armv2"
arm2_elf_name: .asciz "v1"
......@@ -340,7 +330,7 @@ arm3_elf_name: .asciz "v2"
.long arm2_arch_name
.long arm2_elf_name
.long 0
.long cpu_arm2_info
.long cpu_arm2_name
.long arm2_processor_functions
.long 0
.long 0
......@@ -352,7 +342,7 @@ arm3_elf_name: .asciz "v2"
.long arm3_arch_name
.long arm3_elf_name
.long 0
.long cpu_arm250_info
.long cpu_arm250_name
.long arm250_processor_functions
.long 0
.long 0
......@@ -364,7 +354,7 @@ arm3_elf_name: .asciz "v2"
.long arm3_arch_name
.long arm3_elf_name
.long 0
.long cpu_arm3_info
.long cpu_arm3_name
.long arm3_processor_functions
.long 0
.long 0
......
......@@ -287,14 +287,12 @@ ENTRY(cpu_arm7_reset)
mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc
mov pc, r0
cpu_armvlsi_name:
.asciz "ARM/VLSI"
cpu_arm6_name: .asciz "ARM 6"
cpu_arm6_name: .asciz "ARM6"
cpu_arm610_name:
.asciz "ARM 610"
cpu_arm7_name: .asciz "ARM 7"
.asciz "ARM610"
cpu_arm7_name: .asciz "ARM7"
cpu_arm710_name:
.asciz "ARM 710"
.asciz "ARM710"
.align
__INIT
......@@ -387,30 +385,6 @@ ENTRY(arm7_processor_functions)
.size arm7_processor_functions, . - arm7_processor_functions
.type cpu_arm6_info, #object
cpu_arm6_info:
.long cpu_armvlsi_name
.long cpu_arm6_name
.size cpu_arm6_info, . - cpu_arm6_info
.type cpu_arm610_info, #object
cpu_arm610_info:
.long cpu_armvlsi_name
.long cpu_arm610_name
.size cpu_arm610_info, . - cpu_Arm610_info
.type cpu_arm7_info, #object
cpu_arm7_info:
.long cpu_armvlsi_name
.long cpu_arm7_name
.size cpu_arm7_info, . - cpu_arm7_info
.type cpu_arm710_info, #object
cpu_arm710_info:
.long cpu_armvlsi_name
.long cpu_arm710_name
.size cpu_arm710_info, . - cpu_arm710_info
.type cpu_arch_name, #object
cpu_arch_name: .asciz "armv3"
.size cpu_arch_name, . - cpu_arch_name
......@@ -431,7 +405,7 @@ __arm6_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_26BIT
.long cpu_arm6_info
.long cpu_arm6_name
.long arm6_processor_functions
.long v3_tlb_fns
.long v3_user_fns
......@@ -446,7 +420,7 @@ __arm610_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_26BIT
.long cpu_arm610_info
.long cpu_arm610_name
.long arm6_processor_functions
.long v3_tlb_fns
.long v3_user_fns
......@@ -461,7 +435,7 @@ __arm7_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_26BIT
.long cpu_arm7_info
.long cpu_arm7_name
.long arm7_processor_functions
.long v3_tlb_fns
.long v3_user_fns
......@@ -476,7 +450,7 @@ __arm710_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_26BIT
.long cpu_arm710_info
.long cpu_arm710_name
.long arm7_processor_functions
.long v3_tlb_fns
.long v3_user_fns
......
......@@ -168,8 +168,6 @@ ENTRY(cpu_arm720_reset)
mov pc, r0
cpu_armvlsi_name:
.asciz "ARM"
cpu_arm720_name:
.asciz "ARM720T"
.align
......@@ -223,14 +221,8 @@ ENTRY(arm720_processor_functions)
.size arm720_processor_functions, . - arm720_processor_functions
.type cpu_arm720_info, #object
cpu_arm720_info:
.long cpu_armvlsi_name
.long cpu_arm720_name
.size cpu_arm720_info, . - cpu_arm720_info
.type cpu_arch_name, #object
cpu_arch_name: .asciz "armv4"
cpu_arch_name: .asciz "armv4t"
.size cpu_arch_name, . - cpu_arch_name
.type cpu_elf_name, #object
......@@ -253,7 +245,7 @@ __arm720_proc_info:
.long cpu_arch_name @ arch_name
.long cpu_elf_name @ elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB @ elf_hwcap
.long cpu_arm720_info @ info
.long cpu_arm720_name @ name
.long arm720_processor_functions
.long v4_tlb_fns
.long v4wt_user_fns
......
......@@ -419,8 +419,6 @@ ENTRY(cpu_arm920_set_pte)
mov pc, lr
cpu_manu_name:
.asciz "ARM/CIRRUS"
ENTRY(cpu_arm920_name)
.ascii "Arm920T"
#ifndef CONFIG_CPU_ICACHE_DISABLE
......@@ -506,15 +504,9 @@ arm920_processor_functions:
.size arm920_processor_functions, . - arm920_processor_functions
.type cpu_arm920_info, #object
cpu_arm920_info:
.long cpu_manu_name
.long cpu_arm920_name
.size cpu_arm920_info, . - cpu_arm920_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
.asciz "armv4t"
.size cpu_arch_name, . - cpu_arch_name
.type cpu_elf_name, #object
......@@ -534,7 +526,7 @@ __arm920_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
.long cpu_arm920_info
.long cpu_arm920_name
.long arm920_processor_functions
.long v4wbi_tlb_fns
.long v4wb_user_fns
......
......@@ -418,8 +418,6 @@ ENTRY(cpu_arm922_set_pte)
mov pc, lr
cpu_manu_name:
.asciz "ARM/ALTERA"
ENTRY(cpu_arm922_name)
.ascii "Arm922T"
#ifndef CONFIG_CPU_ICACHE_DISABLE
......@@ -505,15 +503,9 @@ arm922_processor_functions:
.size arm922_processor_functions, . - arm922_processor_functions
.type cpu_arm922_info, #object
cpu_arm922_info:
.long cpu_manu_name
.long cpu_arm922_name
.size cpu_arm922_info, . - cpu_arm922_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
.asciz "armv4t"
.size cpu_arch_name, . - cpu_arch_name
.type cpu_elf_name, #object
......@@ -533,7 +525,7 @@ __arm922_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB
.long cpu_arm922_info
.long cpu_arm922_name
.long arm922_processor_functions
.long v4wbi_tlb_fns
.long v4wb_user_fns
......
......@@ -403,8 +403,6 @@ ENTRY(cpu_arm926_set_pte)
mov pc, lr
cpu_manu_name:
.asciz "ARM"
ENTRY(cpu_arm926_name)
.ascii "ARM926EJ-S"
#ifndef CONFIG_CPU_ICACHE_DISABLE
......@@ -503,12 +501,6 @@ arm926_processor_functions:
.size arm926_processor_functions, . - arm926_processor_functions
.type cpu_arm926_info, #object
cpu_arm926_info:
.long cpu_manu_name
.long cpu_arm926_name
.size cpu_arm926_info, . - cpu_arm926_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5tej"
......@@ -532,7 +524,7 @@ __arm926_proc_info:
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB | \
HWCAP_FAST_MULT | HWCAP_JAVA
.long cpu_arm926_info
.long cpu_arm926_name
.long arm926_processor_functions
.long v4wbi_tlb_fns
.long v4wb_user_fns
......
......@@ -473,8 +473,6 @@ ENTRY(cpu_sa1100_set_pte)
mov pc, lr
cpu_manu_name:
.asciz "Intel"
cpu_sa110_name:
.asciz "StrongARM-110"
cpu_sa1100_name:
......@@ -547,13 +545,6 @@ ENTRY(sa110_processor_functions)
.size sa110_processor_functions, . - sa110_processor_functions
.type cpu_sa110_info, #object
cpu_sa110_info:
.long cpu_manu_name
.long cpu_sa110_name
.size cpu_sa110_info, . - cpu_sa110_info
/*
* SA1100 and SA1110 share the same function calls
*/
......@@ -587,16 +578,6 @@ ENTRY(sa1100_processor_functions)
.size sa1100_processor_functions, . - sa1100_processor_functions
cpu_sa1100_info:
.long cpu_manu_name
.long cpu_sa1100_name
.size cpu_sa1100_info, . - cpu_sa1100_info
cpu_sa1110_info:
.long cpu_manu_name
.long cpu_sa1110_name
.size cpu_sa1110_info, . - cpu_sa1110_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
......@@ -620,7 +601,7 @@ __sa110_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
.long cpu_sa110_info
.long cpu_sa110_name
.long sa110_processor_functions
.long v4wb_tlb_fns
.long v4wb_user_fns
......@@ -637,7 +618,7 @@ __sa1100_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
.long cpu_sa1100_info
.long cpu_sa1100_name
.long sa1100_processor_functions
.long v4wb_tlb_fns
.long v4_mc_user_fns
......@@ -652,7 +633,7 @@ __sa1110_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP | HWCAP_HALF | HWCAP_26BIT | HWCAP_FAST_MULT
.long cpu_sa1110_info
.long cpu_sa1110_name
.long sa1100_processor_functions
.long v4wb_tlb_fns
.long v4_mc_user_fns
......
......@@ -651,9 +651,6 @@ ENTRY(cpu_xscale_set_pte)
.ltorg
cpu_manu_name:
.asciz "Intel"
cpu_80200_name:
.asciz "XScale-80200"
......@@ -723,24 +720,6 @@ ENTRY(xscale_processor_functions)
.word cpu_xscale_set_pte
.size xscale_processor_functions, . - xscale_processor_functions
.type cpu_80200_info, #object
cpu_80200_info:
.long cpu_manu_name
.long cpu_80200_name
.size cpu_80200_info, . - cpu_80200_info
.type cpu_pxa250_info, #object
cpu_pxa250_info:
.long cpu_manu_name
.long cpu_pxa250_name
.size cpu_pxa250_info, . - cpu_pxa250_info
.type cpu_pxa210_info, #object
cpu_pxa210_info:
.long cpu_manu_name
.long cpu_pxa210_name
.size cpu_pxa210_info, . - cpu_pxa210_info
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5te"
......@@ -763,7 +742,7 @@ __80200_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
.long cpu_80200_info
.long cpu_80200_name
.long xscale_processor_functions
.long v4wbi_tlb_fns
.long xscale_mc_user_fns
......@@ -778,7 +757,7 @@ __pxa250_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
.long cpu_pxa250_info
.long cpu_pxa250_name
.long xscale_processor_functions
.long v4wbi_tlb_fns
.long xscale_mc_user_fns
......@@ -793,7 +772,7 @@ __pxa210_proc_info:
.long cpu_arch_name
.long cpu_elf_name
.long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
.long cpu_pxa210_info
.long cpu_pxa210_name
.long xscale_processor_functions
.long v4wbi_tlb_fns
.long xscale_mc_user_fns
......
......@@ -75,6 +75,12 @@ SECTIONS
__stop___ex_table = .;
}
__gpl_ksymtab : { /* GPL Kernel symbol table */
__start___gpl_ksymtab = .;
*(__gpl_ksymtab)
__stop___gpl_ksymtab = .;
}
__ksymtab : { /* Kernel symbol table */
__start___ksymtab = .;
*(__ksymtab)
......
......@@ -26,6 +26,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/dma.h>
#include <asm/ecard.h>
......@@ -163,26 +164,27 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type)
{
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel;
outb(ALATCH_DIS_DMA, info->alatch);
if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir, alatch_dir;
int bufs, map_dir, dma_dir, alatch_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE,
map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE,
alatch_dir = ALATCH_DMA_OUT;
else
pci_dir = PCI_DMA_FROMDEVICE,
map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ,
alatch_dir = ALATCH_DMA_IN;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1);
......
......@@ -32,6 +32,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -165,22 +166,23 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type)
{
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel;
if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir;
int bufs, map_dir, dma_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE,
map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE;
else
pci_dir = PCI_DMA_FROMDEVICE,
map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1);
......
......@@ -17,6 +17,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/dma-mapping.h>
#include <asm/dma.h>
#include <asm/ecard.h>
......@@ -135,22 +136,23 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
fasdmadir_t direction, fasdmatype_t min_type)
{
struct powertec_info *info = (struct powertec_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
int dmach = host->dma_channel;
if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) {
int bufs, pci_dir, dma_dir;
int bufs, map_dir, dma_dir;
bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
if (direction == DMA_OUT)
pci_dir = PCI_DMA_TODEVICE,
map_dir = DMA_TO_DEVICE,
dma_dir = DMA_MODE_WRITE;
else
pci_dir = PCI_DMA_FROMDEVICE,
map_dir = DMA_FROM_DEVICE,
dma_dir = DMA_MODE_READ;
pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
dma_map_sg(dev, info->sg, bufs + 1, map_dir);
disable_dma(dmach);
set_dma_sg(dmach, info->sg, bufs + 1);
......
......@@ -168,6 +168,19 @@ config 977_WATCHDOG
Not sure? It's safe to say N.
config SA1100_WATCHDOG
tristate "SA1100 watchdog"
depends on WATCHDOG && ARCH_SA1100
help
Watchdog timer embedded into SA11x0 chips. This will reboot your
system when timeout is reached.
NOTE, that once enabled, this timer cannot be disabled.
This driver is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
If you want to compile it as a module, say M here and read
Documentation/modules.txt. The module will be called sa1100_wdt.o.
config EUROTECH_WDT
tristate "Eurotech CPU-1220/1410 Watchdog Timer"
depends on WATCHDOG
......
......@@ -21,6 +21,7 @@ obj-$(CONFIG_977_WATCHDOG) += wdt977.o
obj-$(CONFIG_I810_TCO) += i810-tco.o
obj-$(CONFIG_MACHZ_WDT) += machzwd.o
obj-$(CONFIG_SH_WDT) += shwdt.o
obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
......
/*
* Watchdog driver for the SA11x0
*
* (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
* Based on SoftDog driver by Alan Cox <alan@redhat.com>
*
* 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.
*
* Neither Oleg Drokin nor iXcelerator.com admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
*
* 27/11/2000 Initial release
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#define OSCR_FREQ 3686400
#define SA1100_CLOSE_MAGIC (0x5afc4453)
static unsigned long sa1100wdt_users;
static int expect_close;
static int pre_margin;
static int boot_status;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
/*
* Allow only one person to hold it open
*/
static int sa1100dog_open(struct inode *inode, struct file *file)
{
if (test_and_set_bit(1,&sa1100wdt_users))
return -EBUSY;
/* Activate SA1100 Watchdog timer */
OSMR3 = OSCR + pre_margin;
OSSR = OSSR_M3;
OWER = OWER_WME;
OIER |= OIER_E3;
return 0;
}
/*
* Shut off the timer.
* Lock it in if it's a module and we defined ...NOWAYOUT
* Oddly, the watchdog can only be enabled, but we can turn off
* the interrupt, which appears to prevent the watchdog timing out.
*/
static int sa1100dog_release(struct inode *inode, struct file *file)
{
OSMR3 = OSCR + pre_margin;
if (expect_close == SA1100_CLOSE_MAGIC) {
OIER &= ~OIER_E3;
} else {
printk(KERN_CRIT "WATCHDOG: WDT device closed unexpectedly. WDT will not stop!\n");
}
clear_bit(1, &sa1100wdt_users);
return 0;
}
static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos)
{
/* Can't seek (pwrite) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;
if (len) {
if (!nowayout) {
size_t i;
expect_close = 0;
for (i = 0; i != len; i++) {
char c;
if (get_user(c, data + i))
return -EFAULT;
if (c == 'V')
expect_close = SA1100_CLOSE_MAGIC;
}
}
/* Refresh OSMR3 timer. */
OSMR3 = OSCR + pre_margin;
}
return len ? 1 : 0;
}
static struct watchdog_info ident = {
.options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE |
WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
.identity = "SA1100 Watchdog",
};
static int sa1100dog_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
int ret = -ENOIOCTLCMD;
int time;
switch (cmd) {
case WDIOC_GETSUPPORT:
ret = copy_to_user((struct watchdog_info *)arg, &ident,
sizeof(ident)) ? -EFAULT : 0;
break;
case WDIOC_GETSTATUS:
ret = put_user(0, (int *)arg);
break;
case WDIOC_GETBOOTSTATUS:
ret = put_user(boot_status, (int *)arg);
break;
case WDIOC_SETTIMEOUT:
ret = get_user(time, (int *)arg);
if (ret)
break;
if (time <= 0 || time > 255) {
ret = -EINVAL;
break;
}
pre_margin = OSCR_FREQ * time;
OSMR3 = OSCR + pre_margin;
/*fall through*/
case WDIOC_GETTIMEOUT:
ret = put_user(pre_margin / OSCR_FREQ, (int *)arg);
break;
case WDIOC_KEEPALIVE:
OSMR3 = OSCR + pre_margin;
ret = 0;
break;
}
return ret;
}
static struct file_operations sa1100dog_fops =
{
.owner = THIS_MODULE,
.write = sa1100dog_write,
.ioctl = sa1100dog_ioctl,
.open = sa1100dog_open,
.release = sa1100dog_release,
};
static struct miscdevice sa1100dog_miscdev =
{
.minor = WATCHDOG_MINOR,
.name = "SA1100 watchdog",
.fops = &sa1100dog_fops,
};
static int margin __initdata = 60; /* (secs) Default is 1 minute */
static int __init sa1100dog_init(void)
{
int ret;
/*
* Read the reset status, and save it for later. If
* we suspend, RCSR will be cleared, and the watchdog
* reset reason will be lost.
*/
boot_status = (RCSR & RCSR_WDR) ? WDIOF_CARDRESET : 0;
pre_margin = OSCR_FREQ * margin;
ret = misc_register(&sa1100dog_miscdev);
if (ret == 0)
printk("SA1100 Watchdog Timer: timer margin %d sec\n",
margin);
return ret;
}
static void __exit sa1100dog_exit(void)
{
misc_deregister(&sa1100dog_miscdev);
}
module_init(sa1100dog_init);
module_exit(sa1100dog_exit);
MODULE_AUTHOR("Oleg Drokin <green@crimea.edu>");
MODULE_DESCRIPTION("SA1100 Watchdog");
MODULE_PARM(margin,"i");
MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)");
MODULE_PARM(nowayout, "i");
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started");
MODULE_LICENSE("GPL");
......@@ -89,6 +89,7 @@ config SERIO_PARKBD
config SERIO_RPCKBD
tristate "Acorn RiscPC keyboard controller"
depends on ARCH_ACORN && SERIO
default y
help
Say Y here if you have the Acorn RiscPC and want to use an AT
keyboard connected to its keyboard controller.
......
This diff is collapsed.
......@@ -10,8 +10,7 @@
* Infra-red driver for the StrongARM SA1100 embedded microprocessor
*
* Note that we don't have to worry about the SA1111's DMA bugs in here,
* so we use the straight forward pci_map_* functions with a null pointer.
* IMHO we should really be using our own machine specific set.
* so we use the straight forward dma_map_* functions with a null pointer.
*
* This driver takes one kernel command line parameter, sa1100ir=, with
* the following options:
......@@ -29,8 +28,8 @@
#include <linux/rtnetlink.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <net/irda/irda.h>
#include <net/irda/wrapper.h>
......@@ -57,11 +56,6 @@ static int power_level = 3;
static int tx_lpm;
static int max_rate = 4000000;
/*
* Our netdevice. There is only ever one of these.
*/
static struct net_device *netdev;
struct sa1100_irda {
unsigned char hscr0;
unsigned char utcr4;
......@@ -79,8 +73,8 @@ struct sa1100_irda {
dma_regs_t *rxdma;
struct net_device_stats stats;
struct device *dev;
struct irlap_cb *irlap;
struct pm_dev *pmdev;
struct qos_info qos;
iobuff_t tx_buff;
......@@ -112,9 +106,9 @@ static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
*/
skb_reserve(si->rxskb, 1);
si->rxbuf_dma = pci_map_single(NULL, si->rxskb->data,
si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
HPSIR_MAX_RXLEN,
PCI_DMA_FROMDEVICE);
DMA_FROM_DEVICE);
return 0;
}
......@@ -361,11 +355,12 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si)
/*
* Suspend the IrDA interface.
*/
static int sa1100_irda_suspend(struct net_device *dev, int state)
static int sa1100_irda_suspend(struct device *_dev, u32 state, u32 level)
{
struct net_device *dev = dev_get_drvdata(_dev);
struct sa1100_irda *si = dev->priv;
if (si && si->open) {
if (si && si->open && level == SUSPEND_DISABLE) {
/*
* Stop the transmit queue
*/
......@@ -381,11 +376,12 @@ static int sa1100_irda_suspend(struct net_device *dev, int state)
/*
* Resume the IrDA interface.
*/
static int sa1100_irda_resume(struct net_device *dev)
static int sa1100_irda_resume(struct device *_dev, u32 level)
{
struct net_device *dev = dev_get_drvdata(_dev);
struct sa1100_irda *si = dev->priv;
if (si && si->open) {
if (si && si->open && level == RESUME_ENABLE) {
/*
* If we missed a speed change, initialise at the new speed
* directly. It is debatable whether this is actually
......@@ -410,31 +406,9 @@ static int sa1100_irda_resume(struct net_device *dev)
return 0;
}
static int sa1100_irda_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data)
{
int ret;
if (!dev->data)
return -EINVAL;
switch (rqst) {
case PM_SUSPEND:
ret = sa1100_irda_suspend((struct net_device *)dev->data,
(int)data);
break;
case PM_RESUME:
ret = sa1100_irda_resume((struct net_device *)dev->data);
break;
default:
ret = -EINVAL;
break;
}
return ret;
}
#else
#define sa1100_irda_suspend NULL
#define sa1100_irda_resume NULL
#endif
/*
......@@ -555,7 +529,7 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
len = dma_addr - si->rxbuf_dma;
if (len > HPSIR_MAX_RXLEN)
len = HPSIR_MAX_RXLEN;
pci_unmap_single(NULL, si->rxbuf_dma, len, PCI_DMA_FROMDEVICE);
dma_unmap_single(si->dev, si->rxbuf_dma, len, DMA_FROM_DEVICE);
do {
/*
......@@ -603,9 +577,9 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
/*
* Remap the buffer.
*/
si->rxbuf_dma = pci_map_single(NULL, si->rxskb->data,
si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
HPSIR_MAX_RXLEN,
PCI_DMA_FROMDEVICE);
DMA_FROM_DEVICE);
}
}
......@@ -716,7 +690,7 @@ static void sa1100_irda_txdma_irq(void *id)
* Account and free the packet.
*/
if (skb) {
pci_unmap_single(NULL, si->txbuf_dma, skb->len, PCI_DMA_TODEVICE);
dma_unmap_single(si->dev, si->txbuf_dma, skb->len, DMA_TO_DEVICE);
si->stats.tx_packets ++;
si->stats.tx_bytes += skb->len;
dev_kfree_skb_irq(skb);
......@@ -782,8 +756,8 @@ static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
si->txskb = skb;
si->txbuf_dma = pci_map_single(NULL, skb->data,
skb->len, PCI_DMA_TODEVICE);
si->txbuf_dma = dma_map_single(si->dev, skb->data,
skb->len, DMA_TO_DEVICE);
sa1100_start_dma(si->txdma, si->txbuf_dma, skb->len);
......@@ -931,8 +905,8 @@ static int sa1100_irda_stop(struct net_device *dev)
* tidy that up cleanly.
*/
if (si->rxskb) {
pci_unmap_single(NULL, si->rxbuf_dma, HPSIR_MAX_RXLEN,
PCI_DMA_FROMDEVICE);
dma_unmap_single(si->dev, si->rxbuf_dma, HPSIR_MAX_RXLEN,
DMA_FROM_DEVICE);
dev_kfree_skb(si->rxskb);
si->rxskb = NULL;
}
......@@ -972,6 +946,24 @@ static int sa1100_irda_init_iobuf(iobuff_t *io, int size)
return io->head ? 0 : -ENOMEM;
}
static struct device_driver sa1100ir_driver = {
.name = "sa1100ir",
.bus = &system_bus_type,
.suspend = sa1100_irda_suspend,
.resume = sa1100_irda_resume,
};
static struct sys_device sa1100ir_device = {
.name = "sa1100ir",
.id = 0,
.root = NULL,
.dev = {
.name = "Intel Corporation SA11x0 [IrDA]",
.bus_id = "0",
.driver = &sa1100ir_driver,
},
};
static int sa1100_irda_net_init(struct net_device *dev)
{
struct sa1100_irda *si = dev->priv;
......@@ -984,6 +976,8 @@ static int sa1100_irda_net_init(struct net_device *dev)
memset(si, 0, sizeof(*si));
si->dev = &sa1100ir_device.dev;
/*
* Initialise the HP-SIR buffers
*/
......@@ -1035,15 +1029,6 @@ static int sa1100_irda_net_init(struct net_device *dev)
Ser2UTCR4 = si->utcr4;
Ser2HSCR0 = HSCR0_UART;
#ifdef CONFIG_PM
/*
* Power-Management is optional.
*/
si->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, sa1100_irda_pmproc);
if (si->pmdev)
si->pmdev->data = dev;
#endif
return 0;
kfree(si->tx_buff.head);
......@@ -1071,15 +1056,12 @@ static void sa1100_irda_net_uninit(struct net_device *dev)
dev->get_stats = NULL;
dev->priv = NULL;
pm_unregister(si->pmdev);
kfree(si->tx_buff.head);
kfree(si->rx_buff.head);
kfree(si);
}
static
int __init sa1100_irda_init(void)
static int __init sa1100_irda_init(void)
{
struct net_device *dev;
int err;
......@@ -1102,6 +1084,9 @@ int __init sa1100_irda_init(void)
if (err)
goto err_mem_3;
driver_register(&sa1100ir_driver);
sys_device_register(&sa1100ir_device);
rtnl_lock();
dev = dev_alloc("irda%d", &err);
if (dev) {
......@@ -1114,11 +1099,14 @@ int __init sa1100_irda_init(void)
if (err)
kfree(dev);
else
netdev = dev;
dev_set_drvdata(&sa1100ir_device.dev, dev);
}
rtnl_unlock();
if (err) {
sys_device_unregister(&sa1100ir_device);
driver_unregister(&sa1100ir_driver);
release_mem_region(__PREG(Ser2HSCR2), 0x04);
err_mem_3:
release_mem_region(__PREG(Ser2HSCR0), 0x1c);
......@@ -1131,15 +1119,17 @@ int __init sa1100_irda_init(void)
static void __exit sa1100_irda_exit(void)
{
struct net_device *dev = netdev;
struct net_device *dev = dev_get_drvdata(&sa1100ir_device.dev);
netdev = NULL;
if (dev) {
rtnl_lock();
unregister_netdevice(dev);
rtnl_unlock();
}
sys_device_unregister(&sa1100ir_device);
driver_unregister(&sa1100ir_driver);
release_mem_region(__PREG(Ser2HSCR2), 0x04);
release_mem_region(__PREG(Ser2HSCR0), 0x1c);
release_mem_region(__PREG(Ser2UTCR0), 0x24);
......
......@@ -185,7 +185,6 @@ int usb_hcd_sa1111_probe (const struct hc_driver *driver,
goto err1;
}
set_irq_type(hcd->irq, IRQT_RISING);
retval = request_irq (hcd->irq, usb_hcd_sa1111_hcim_irq, SA_INTERRUPT,
hcd->description, hcd);
if (retval != 0) {
......@@ -399,7 +398,7 @@ static int ohci_hcd_sa1111_drv_resume(struct device *dev, u32 level)
static struct sa1111_driver ohci_hcd_sa1111_driver = {
.drv = {
.name = "SA1111 OHCI",
.name = "sa1111-ohci",
.bus = &sa1111_bus_type,
.probe = ohci_hcd_sa1111_drv_probe,
.remove = ohci_hcd_sa1111_drv_remove,
......
This diff is collapsed.
......@@ -14,7 +14,7 @@
* devices. This is the "generic" version. The PCI specific version
* is in pci.h
*/
extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle, unsigned long flags);
extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
extern void consistent_sync(void *kaddr, size_t size, int rw);
......@@ -84,12 +84,12 @@ static inline int dma_is_consistent(dma_addr_t handle)
static inline void *
dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle)
{
int gfp = GFP_KERNEL;
int gfp = GFP_ATOMIC;
if (dev == NULL || dmadev_is_sa1111(dev) || *dev->dma_mask != 0xffffffff)
gfp |= GFP_DMA;
return consistent_alloc(gfp, size, handle);
return consistent_alloc(gfp, size, handle, 0);
}
/**
......
......@@ -160,6 +160,7 @@ struct expansion_card {
const char *card_desc; /* Card description */
CONST unsigned int podaddr; /* Base Linux address for card */
CONST loader_t loader; /* loader program */
u64 dma_mask;
};
struct in_chunk_dir {
......
......@@ -40,13 +40,13 @@ static inline void pcibios_penalize_isa_irq(int irq)
static inline void *
pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handle)
{
int gfp = GFP_KERNEL;
int gfp = GFP_ATOMIC;
if (hwdev == NULL || pcidev_is_sa1111(hwdev) ||
hwdev->dma_mask != 0xffffffff)
gfp |= GFP_DMA;
return consistent_alloc(gfp, size, handle);
return consistent_alloc(gfp, size, handle, 0);
}
static inline void
......
......@@ -12,7 +12,7 @@
* Note that this is actually 0x1,0000,0000
*/
#define KERNEL_DS 0x00000000
#define USER_DS PAGE_OFFSET
#define USER_DS TASK_SIZE
static inline void set_fs (mm_segment_t fs)
{
......@@ -50,8 +50,8 @@ static inline void set_fs (mm_segment_t fs)
" .align 3\n" \
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err) \
: "r" (x), "r" (__pu_addr), "i" (-EFAULT), "0" (err) \
: "+r" (err) \
: "r" (x), "r" (__pu_addr), "i" (-EFAULT) \
: "cc")
#ifndef __ARMEB__
......@@ -83,19 +83,18 @@ static inline void set_fs (mm_segment_t fs)
" .align 3\n" \
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err) \
: "r" (x), "r" (__pu_addr), "i" (-EFAULT), "0" (err))
: "+r" (err) \
: "r" (x), "r" (__pu_addr), "i" (-EFAULT) \
: "cc")
#define __put_user_asm_dword(x,__pu_addr,err) \
({ \
unsigned long long __temp = (unsigned long long)x; \
__asm__ __volatile__( \
"1: strt %1, [%2], #0\n" \
"2: strt %3, [%4], #0\n" \
"1: strt %Q2, [%1], #4\n" \
"2: strt %R2, [%1], #0\n" \
"3:\n" \
" .section .fixup,\"ax\"\n" \
" .align 2\n" \
"4: mov %0, %5\n" \
"4: mov %0, %3\n" \
" b 3b\n" \
" .previous\n" \
" .section __ex_table,\"a\"\n" \
......@@ -103,12 +102,9 @@ static inline void set_fs (mm_segment_t fs)
" .long 1b, 4b\n" \
" .long 2b, 4b\n" \
" .previous" \
: "=r" (err) \
: "r" (__temp), "r" (__pu_addr), \
"r" (__temp >> 32), "r" (__pu_addr + 4), \
"i" (-EFAULT), "0" (err) \
: "cc"); \
})
: "+r" (err), "+r" (__pu_addr) \
: "r" (x), "i" (-EFAULT) \
: "cc")
#define __get_user_asm_byte(x,addr,err) \
__asm__ __volatile__( \
......@@ -124,23 +120,24 @@ static inline void set_fs (mm_segment_t fs)
" .align 3\n" \
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err), "=&r" (x) \
: "r" (addr), "i" (-EFAULT), "0" (err))
: "+r" (err), "=&r" (x) \
: "r" (addr), "i" (-EFAULT) \
: "cc")
#ifndef __ARMEB__
#define __get_user_asm_half(x,addr,err) \
#define __get_user_asm_half(x,__gu_addr,err) \
({ \
unsigned long __b1, __b2, __ptr = (unsigned long)addr; \
__get_user_asm_byte(__b1, __ptr, err); \
__get_user_asm_byte(__b2, __ptr + 1, err); \
unsigned long __b1, __b2; \
__get_user_asm_byte(__b1, __gu_addr, err); \
__get_user_asm_byte(__b2, __gu_addr + 1, err); \
(x) = __b1 | (__b2 << 8); \
})
#else
#define __get_user_asm_half(x,addr,err) \
#define __get_user_asm_half(x,__gu_addr,err) \
({ \
unsigned long __b1, __b2; \
__get_user_asm_byte(__b1, addr, err); \
__get_user_asm_byte(__b2, (int)(addr) + 1, err); \
__get_user_asm_byte(__b1, __gu_addr, err); \
__get_user_asm_byte(__b2, __gu_addr + 1, err); \
(x) = (__b1 << 8) | __b2; \
})
#endif
......@@ -159,8 +156,9 @@ static inline void set_fs (mm_segment_t fs)
" .align 3\n" \
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err), "=&r" (x) \
: "r" (addr), "i" (-EFAULT), "0" (err))
: "+r" (err), "=&r" (x) \
: "r" (addr), "i" (-EFAULT) \
: "cc")
extern unsigned long __arch_copy_from_user(void *to, const void *from, unsigned long n);
#define __do_copy_from_user(to,from,n) \
......
......@@ -16,11 +16,6 @@ struct cpu_tlb_fns;
struct cpu_user_fns;
struct processor;
struct proc_info_item {
const char *manufacturer;
const char *cpu_name;
};
/*
* Note! struct processor is always defined if we're
* using MULTI_CPU, otherwise this entry is unused,
......@@ -38,7 +33,7 @@ struct proc_info_list {
const char *arch_name;
const char *elf_name;
unsigned int elf_hwcap;
struct proc_info_item *info;
const char *cpu_name;
struct processor *proc;
struct cpu_tlb_fns *tlb;
struct cpu_user_fns *user;
......
......@@ -74,7 +74,7 @@ extern int __get_user_bad(void);
__asm__ __volatile__ ("bl __get_user_" #__s \
: "=&r" (__e), "=r" (__r1) \
: "0" (__p) \
: __i)
: __i, "cc")
#define get_user(x,p) \
({ \
......@@ -100,8 +100,31 @@ extern int __get_user_bad(void);
__e; \
})
#define __get_user(x,p) __get_user_nocheck((x),(p),sizeof(*(p)))
#define __get_user_error(x,p,e) __get_user_nocheck_error((x),(p),sizeof(*(p)),(e))
#define __get_user(x,ptr) \
({ \
long __gu_err = 0; \
__get_user_err((x),(ptr),__gu_err); \
__gu_err; \
})
#define __get_user_error(x,ptr,err) \
({ \
__get_user_err((x),(ptr),err); \
(void) 0; \
})
#define __get_user_err(x,ptr,err) \
do { \
unsigned long __gu_addr = (unsigned long)(ptr); \
unsigned long __gu_val; \
switch (sizeof(*(ptr))) { \
case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break; \
case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break; \
case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break; \
default: (__gu_val) = __get_user_bad(); \
} \
(x) = (__typeof__(*(ptr)))__gu_val; \
} while (0)
extern int __put_user_1(void *, unsigned int);
extern int __put_user_2(void *, unsigned int);
......@@ -113,7 +136,7 @@ extern int __put_user_bad(void);
__asm__ __volatile__ ("bl __put_user_" #__s \
: "=&r" (__e) \
: "0" (__p), "r" (__r1) \
: __i)
: __i, "cc")
#define put_user(x,p) \
({ \
......@@ -138,8 +161,31 @@ extern int __put_user_bad(void);
__e; \
})
#define __put_user(x,p) __put_user_nocheck((__typeof(*(p)))(x),(p),sizeof(*(p)))
#define __put_user_error(x,p,e) __put_user_nocheck_error((x),(p),sizeof(*(p)),(e))
#define __put_user(x,ptr) \
({ \
long __pu_err = 0; \
__put_user_err((x),(ptr),__pu_err); \
__pu_err; \
})
#define __put_user_error(x,ptr,err) \
({ \
__put_user_err((x),(ptr),err); \
(void) 0; \
})
#define __put_user_err(x,ptr,err) \
do { \
unsigned long __pu_addr = (unsigned long)(ptr); \
__typeof__(*(ptr)) __pu_val = (x); \
switch (sizeof(*(ptr))) { \
case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break; \
case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break; \
case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break; \
case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break; \
default: __put_user_bad(); \
} \
} while (0)
static __inline__ unsigned long copy_from_user(void *to, const void *from, unsigned long n)
{
......@@ -209,85 +255,4 @@ static inline long strnlen_user(const char *s, long n)
return res;
}
/*
* These are the work horses of the get/put_user functions
*/
#if 0
#define __get_user_check(x,ptr,size) \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ,__gu_addr,size)) { \
__gu_err = 0; \
__get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
} \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
#endif
#define __get_user_nocheck(x,ptr,size) \
({ \
long __gu_err = 0, __gu_val; \
__get_user_size(__gu_val,(ptr),(size),__gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
})
#define __get_user_nocheck_error(x,ptr,size,err) \
({ \
long __gu_val; \
__get_user_size(__gu_val,(ptr),(size),(err)); \
(x) = (__typeof__(*(ptr)))__gu_val; \
(void) 0; \
})
#define __put_user_check(x,ptr,size) \
({ \
long __pu_err = -EFAULT; \
__typeof__(*(ptr)) *__pu_addr = (ptr); \
if (access_ok(VERIFY_WRITE,__pu_addr,size)) { \
__pu_err = 0; \
__put_user_size((x),__pu_addr,(size),__pu_err); \
} \
__pu_err; \
})
#define __put_user_nocheck(x,ptr,size) \
({ \
long __pu_err = 0; \
unsigned long __pu_addr = (unsigned long)(ptr); \
__put_user_size((x),__pu_addr,(size),__pu_err); \
__pu_err; \
})
#define __put_user_nocheck_error(x,ptr,size,err) \
({ \
unsigned long __pu_addr = (unsigned long)(ptr); \
__put_user_size((x),__pu_addr,(size),err); \
(void) 0; \
})
#define __get_user_size(x,ptr,size,retval) \
do { \
switch (size) { \
case 1: __get_user_asm_byte(x,ptr,retval); break; \
case 2: __get_user_asm_half(x,ptr,retval); break; \
case 4: __get_user_asm_word(x,ptr,retval); break; \
case 8: __get_user_asm_dword(x,ptr,retval); break; \
default: (x) = __get_user_bad(); \
} \
} while (0)
#define __put_user_size(x,ptr,size,retval) \
do { \
switch (size) { \
case 1: __put_user_asm_byte(x,ptr,retval); break; \
case 2: __put_user_asm_half(x,ptr,retval); break; \
case 4: __put_user_asm_word(x,ptr,retval); break; \
case 8: __put_user_asm_dword(x,ptr,retval); break; \
default: __put_user_bad(); \
} \
} while (0)
#endif /* _ASMARM_UACCESS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment