diff options
Diffstat (limited to 'arch/xtensa/kernel')
| -rw-r--r-- | arch/xtensa/kernel/init_task.c | 31 | ||||
| -rw-r--r-- | arch/xtensa/kernel/io.c | 75 |
2 files changed, 106 insertions, 0 deletions
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c new file mode 100644 index 00000000000..cd122fb7e48 --- /dev/null +++ b/arch/xtensa/kernel/init_task.c | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * arch/xtensa/kernel/init_task.c | ||
| 3 | * | ||
| 4 | * Xtensa Processor version. | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | * | ||
| 10 | * Copyright (C) 2007 Tensilica Inc. | ||
| 11 | * | ||
| 12 | * Chris Zankel <chris@zankel.net> | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include <linux/mm.h> | ||
| 16 | #include <linux/fs.h> | ||
| 17 | #include <linux/init.h> | ||
| 18 | #include <linux/init_task.h> | ||
| 19 | #include <linux/module.h> | ||
| 20 | #include <linux/mqueue.h> | ||
| 21 | |||
| 22 | #include <asm/uaccess.h> | ||
| 23 | |||
| 24 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | ||
| 25 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | ||
| 26 | union thread_union init_thread_union __init_task_data = | ||
| 27 | { INIT_THREAD_INFO(init_task) }; | ||
| 28 | |||
| 29 | struct task_struct init_task = INIT_TASK(init_task); | ||
| 30 | |||
| 31 | EXPORT_SYMBOL(init_task); | ||
diff --git a/arch/xtensa/kernel/io.c b/arch/xtensa/kernel/io.c new file mode 100644 index 00000000000..5b65269b1d2 --- /dev/null +++ b/arch/xtensa/kernel/io.c | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | /* | ||
| 2 | * arch/xtensa/io.c | ||
| 3 | * | ||
| 4 | * IO primitives | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * Copied from sparc. | ||
| 12 | * | ||
| 13 | * Chris Zankel <chris@zankel.net> | ||
| 14 | * | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include <asm/io.h> | ||
| 18 | #include <asm/byteorder.h> | ||
| 19 | |||
| 20 | void outsb(unsigned long addr, const void *src, unsigned long count) { | ||
| 21 | while (count) { | ||
| 22 | count -= 1; | ||
| 23 | writeb(*(const char *)src, addr); | ||
| 24 | src += 1; | ||
| 25 | addr += 1; | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | void outsw(unsigned long addr, const void *src, unsigned long count) { | ||
| 30 | while (count) { | ||
| 31 | count -= 2; | ||
| 32 | writew(*(const short *)src, addr); | ||
| 33 | src += 2; | ||
| 34 | addr += 2; | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | void outsl(unsigned long addr, const void *src, unsigned long count) { | ||
| 39 | while (count) { | ||
| 40 | count -= 4; | ||
| 41 | writel(*(const long *)src, addr); | ||
| 42 | src += 4; | ||
| 43 | addr += 4; | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | void insb(unsigned long addr, void *dst, unsigned long count) { | ||
| 48 | while (count) { | ||
| 49 | count -= 1; | ||
| 50 | *(unsigned char *)dst = readb(addr); | ||
| 51 | dst += 1; | ||
| 52 | addr += 1; | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | void insw(unsigned long addr, void *dst, unsigned long count) { | ||
| 57 | while (count) { | ||
| 58 | count -= 2; | ||
| 59 | *(unsigned short *)dst = readw(addr); | ||
| 60 | dst += 2; | ||
| 61 | addr += 2; | ||
| 62 | } | ||
| 63 | } | ||
| 64 | |||
| 65 | void insl(unsigned long addr, void *dst, unsigned long count) { | ||
| 66 | while (count) { | ||
| 67 | count -= 4; | ||
| 68 | /* | ||
| 69 | * XXX I am sure we are in for an unaligned trap here. | ||
| 70 | */ | ||
| 71 | *(unsigned long *)dst = readl(addr); | ||
| 72 | dst += 4; | ||
| 73 | addr += 4; | ||
| 74 | } | ||
| 75 | } | ||
