Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / lib / io-shark.c
blob108d4573e970284ea28aa857975e15b313cd1ad0
1 /*
2 * linux/arch/arm/lib/io-shark.c
4 * by Alexander Schulz
6 * derived from:
7 * linux/arch/arm/lib/io-ebsa.S
8 * Copyright (C) 1995, 1996 Russell King
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
16 #include <asm/io.h>
18 void print_warning(void)
20 printk(KERN_WARNING "ins?/outs? not implemented on this architecture\n");
23 void insl(unsigned int port, void *to, int len)
25 print_warning();
28 void insb(unsigned int port, void *to, int len)
30 print_warning();
33 void outsl(unsigned int port, const void *from, int len)
35 print_warning();
38 void outsb(unsigned int port, const void *from, int len)
40 print_warning();
43 /* these should be in assembler again */
46 * Purpose: read a block of data from a hardware register to memory.
47 * Proto : insw(int from_port, void *to, int len_in_words);
48 * Proto : inswb(int from_port, void *to, int len_in_bytes);
49 * Notes : increment to
52 void insw(unsigned int port, void *to, int len)
54 int i;
56 for (i = 0; i < len; i++)
57 ((unsigned short *) to)[i] = inw(port);
60 void inswb(unsigned int port, void *to, int len)
62 insw(port, to, len >> 2);
66 * Purpose: write a block of data from memory to a hardware register.
67 * Proto : outsw(int to_reg, void *from, int len_in_words);
68 * Proto : outswb(int to_reg, void *from, int len_in_bytes);
69 * Notes : increments from
72 void outsw(unsigned int port, const void *from, int len)
74 int i;
76 for (i = 0; i < len; i++)
77 outw(((unsigned short *) from)[i], port);
80 void outswb(unsigned int port, const void *from, int len)
82 outsw(port, from, len >> 2);