aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300/include/asm
diff options
context:
space:
mode:
authorYoshinori Sato <ysato@users.sourceforge.jp>2008-10-16 01:01:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 14:21:29 -0400
commit81d423e280d193d351f41eacdb3f82c3bb9610c1 (patch)
tree37395cbb8104d0a78ae1e2d7d1ca67bff817eeae /arch/h8300/include/asm
parente0b0f9e4ead2468f84c26332ec42b118e76af572 (diff)
h8300: update timer handler - misc update
- Update selection - Update common timer handler - Add support functions Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/h8300/include/asm')
-rw-r--r--arch/h8300/include/asm/io.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h
index 26dc6ccd9441..33e842f3284b 100644
--- a/arch/h8300/include/asm/io.h
+++ b/arch/h8300/include/asm/io.h
@@ -295,6 +295,40 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned long addr)
295 *(volatile unsigned long*)addr = b; 295 *(volatile unsigned long*)addr = b;
296} 296}
297 297
298static __inline__ void ctrl_bclr(int b, unsigned long addr)
299{
300 if (__builtin_constant_p(b))
301 switch (b) {
302 case 0: __asm__("bclr #0,@%0"::"r"(addr)); break;
303 case 1: __asm__("bclr #1,@%0"::"r"(addr)); break;
304 case 2: __asm__("bclr #2,@%0"::"r"(addr)); break;
305 case 3: __asm__("bclr #3,@%0"::"r"(addr)); break;
306 case 4: __asm__("bclr #4,@%0"::"r"(addr)); break;
307 case 5: __asm__("bclr #5,@%0"::"r"(addr)); break;
308 case 6: __asm__("bclr #6,@%0"::"r"(addr)); break;
309 case 7: __asm__("bclr #7,@%0"::"r"(addr)); break;
310 }
311 else
312 __asm__("bclr %w0,@%1"::"r"(b), "r"(addr));
313}
314
315static __inline__ void ctrl_bset(int b, unsigned long addr)
316{
317 if (__builtin_constant_p(b))
318 switch (b) {
319 case 0: __asm__("bset #0,@%0"::"r"(addr)); break;
320 case 1: __asm__("bset #1,@%0"::"r"(addr)); break;
321 case 2: __asm__("bset #2,@%0"::"r"(addr)); break;
322 case 3: __asm__("bset #3,@%0"::"r"(addr)); break;
323 case 4: __asm__("bset #4,@%0"::"r"(addr)); break;
324 case 5: __asm__("bset #5,@%0"::"r"(addr)); break;
325 case 6: __asm__("bset #6,@%0"::"r"(addr)); break;
326 case 7: __asm__("bset #7,@%0"::"r"(addr)); break;
327 }
328 else
329 __asm__("bset %w0,@%1"::"r"(b), "r"(addr));
330}
331
298/* Pages to physical address... */ 332/* Pages to physical address... */
299#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) 333#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
300#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) 334#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)