diff options
Diffstat (limited to 'arch/um')
| -rw-r--r-- | arch/um/drivers/mconsole_kern.c | 4 | ||||
| -rw-r--r-- | arch/um/drivers/net_kern.c | 2 | ||||
| -rw-r--r-- | arch/um/drivers/ubd_kern.c | 4 | ||||
| -rw-r--r-- | arch/um/kernel/mem.c | 2 | ||||
| -rw-r--r-- | arch/um/kernel/physmem.c | 15 | ||||
| -rw-r--r-- | arch/um/kernel/skas/process.c | 4 | ||||
| -rw-r--r-- | arch/um/os-Linux/aio.c | 47 | ||||
| -rw-r--r-- | arch/um/os-Linux/process.c | 2 | ||||
| -rw-r--r-- | arch/um/os-Linux/user_syms.c | 5 | ||||
| -rw-r--r-- | arch/um/sys-i386/Makefile | 2 |
10 files changed, 33 insertions, 54 deletions
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 542c9ef858f8..d87090507401 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
| @@ -499,7 +499,7 @@ static struct mc_device mem_mc = { | |||
| 499 | .remove = mem_remove, | 499 | .remove = mem_remove, |
| 500 | }; | 500 | }; |
| 501 | 501 | ||
| 502 | static int mem_mc_init(void) | 502 | static int __init mem_mc_init(void) |
| 503 | { | 503 | { |
| 504 | if(can_drop_memory()) | 504 | if(can_drop_memory()) |
| 505 | mconsole_register_dev(&mem_mc); | 505 | mconsole_register_dev(&mem_mc); |
| @@ -798,7 +798,7 @@ void mconsole_stack(struct mc_request *req) | |||
| 798 | */ | 798 | */ |
| 799 | static char *notify_socket = NULL; | 799 | static char *notify_socket = NULL; |
| 800 | 800 | ||
| 801 | static int mconsole_init(void) | 801 | static int __init mconsole_init(void) |
| 802 | { | 802 | { |
| 803 | /* long to avoid size mismatch warnings from gcc */ | 803 | /* long to avoid size mismatch warnings from gcc */ |
| 804 | long sock; | 804 | long sock; |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 72773dd54425..d35d0c1ee7f4 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
| @@ -623,7 +623,7 @@ static int eth_setup_common(char *str, int index) | |||
| 623 | return found; | 623 | return found; |
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | static int eth_setup(char *str) | 626 | static int __init eth_setup(char *str) |
| 627 | { | 627 | { |
| 628 | struct eth_init *new; | 628 | struct eth_init *new; |
| 629 | char *error; | 629 | char *error; |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index fc27f6c72b41..aff661fe2ee1 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
| @@ -469,7 +469,7 @@ __uml_help(fakehd, | |||
| 469 | " Change the ubd device name to \"hd\".\n\n" | 469 | " Change the ubd device name to \"hd\".\n\n" |
| 470 | ); | 470 | ); |
| 471 | 471 | ||
| 472 | static void do_ubd_request(request_queue_t * q); | 472 | static void do_ubd_request(struct request_queue * q); |
| 473 | 473 | ||
| 474 | /* Only changed by ubd_init, which is an initcall. */ | 474 | /* Only changed by ubd_init, which is an initcall. */ |
| 475 | int thread_fd = -1; | 475 | int thread_fd = -1; |
| @@ -1081,7 +1081,7 @@ static void prepare_request(struct request *req, struct io_thread_req *io_req, | |||
| 1081 | } | 1081 | } |
| 1082 | 1082 | ||
| 1083 | /* Called with dev->lock held */ | 1083 | /* Called with dev->lock held */ |
| 1084 | static void do_ubd_request(request_queue_t *q) | 1084 | static void do_ubd_request(struct request_queue *q) |
| 1085 | { | 1085 | { |
| 1086 | struct io_thread_req *io_req; | 1086 | struct io_thread_req *io_req; |
| 1087 | struct request *req; | 1087 | struct request *req; |
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 72ff85693a39..d2b11f242698 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
| @@ -62,7 +62,7 @@ static void setup_highmem(unsigned long highmem_start, | |||
| 62 | } | 62 | } |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 65 | void mem_init(void) | 65 | void __init mem_init(void) |
| 66 | { | 66 | { |
| 67 | /* clear the zero-page */ | 67 | /* clear the zero-page */ |
| 68 | memset((void *) empty_zero_page, 0, PAGE_SIZE); | 68 | memset((void *) empty_zero_page, 0, PAGE_SIZE); |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 3ba6e4c841da..5ee7e851bbc1 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
| @@ -28,7 +28,8 @@ unsigned long high_physmem; | |||
| 28 | 28 | ||
| 29 | extern unsigned long long physmem_size; | 29 | extern unsigned long long physmem_size; |
| 30 | 30 | ||
| 31 | int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) | 31 | int __init init_maps(unsigned long physmem, unsigned long iomem, |
| 32 | unsigned long highmem) | ||
| 32 | { | 33 | { |
| 33 | struct page *p, *map; | 34 | struct page *p, *map; |
| 34 | unsigned long phys_len, phys_pages, highmem_len, highmem_pages; | 35 | unsigned long phys_len, phys_pages, highmem_len, highmem_pages; |
| @@ -47,13 +48,7 @@ int init_maps(unsigned long physmem, unsigned long iomem, unsigned long highmem) | |||
| 47 | total_pages = phys_pages + iomem_pages + highmem_pages; | 48 | total_pages = phys_pages + iomem_pages + highmem_pages; |
| 48 | total_len = phys_len + iomem_len + highmem_len; | 49 | total_len = phys_len + iomem_len + highmem_len; |
| 49 | 50 | ||
| 50 | if(kmalloc_ok){ | 51 | map = alloc_bootmem_low_pages(total_len); |
| 51 | map = kmalloc(total_len, GFP_KERNEL); | ||
| 52 | if(map == NULL) | ||
| 53 | map = vmalloc(total_len); | ||
| 54 | } | ||
| 55 | else map = alloc_bootmem_low_pages(total_len); | ||
| 56 | |||
| 57 | if(map == NULL) | 52 | if(map == NULL) |
| 58 | return -ENOMEM; | 53 | return -ENOMEM; |
| 59 | 54 | ||
| @@ -98,8 +93,8 @@ void map_memory(unsigned long virt, unsigned long phys, unsigned long len, | |||
| 98 | 93 | ||
| 99 | extern int __syscall_stub_start; | 94 | extern int __syscall_stub_start; |
| 100 | 95 | ||
| 101 | void setup_physmem(unsigned long start, unsigned long reserve_end, | 96 | void __init setup_physmem(unsigned long start, unsigned long reserve_end, |
| 102 | unsigned long len, unsigned long long highmem) | 97 | unsigned long len, unsigned long long highmem) |
| 103 | { | 98 | { |
| 104 | unsigned long reserve = reserve_end - start; | 99 | unsigned long reserve = reserve_end - start; |
| 105 | int pfn = PFN_UP(__pa(reserve_end)); | 100 | int pfn = PFN_UP(__pa(reserve_end)); |
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 2a69a7ce5792..48051a98525f 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
| @@ -145,7 +145,7 @@ void init_idle_skas(void) | |||
| 145 | 145 | ||
| 146 | extern void start_kernel(void); | 146 | extern void start_kernel(void); |
| 147 | 147 | ||
| 148 | static int start_kernel_proc(void *unused) | 148 | static int __init start_kernel_proc(void *unused) |
| 149 | { | 149 | { |
| 150 | int pid; | 150 | int pid; |
| 151 | 151 | ||
| @@ -165,7 +165,7 @@ extern int userspace_pid[]; | |||
| 165 | 165 | ||
| 166 | extern char cpu0_irqstack[]; | 166 | extern char cpu0_irqstack[]; |
| 167 | 167 | ||
| 168 | int start_uml_skas(void) | 168 | int __init start_uml_skas(void) |
| 169 | { | 169 | { |
| 170 | stack_protections((unsigned long) &cpu0_irqstack); | 170 | stack_protections((unsigned long) &cpu0_irqstack); |
| 171 | set_sigstack(cpu0_irqstack, THREAD_SIZE); | 171 | set_sigstack(cpu0_irqstack, THREAD_SIZE); |
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c index b126df4ea168..59348359f9ab 100644 --- a/arch/um/os-Linux/aio.c +++ b/arch/um/os-Linux/aio.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "init.h" | 14 | #include "init.h" |
| 15 | #include "user.h" | 15 | #include "user.h" |
| 16 | #include "mode.h" | 16 | #include "mode.h" |
| 17 | #include "kern_constants.h" | ||
| 17 | 18 | ||
| 18 | struct aio_thread_req { | 19 | struct aio_thread_req { |
| 19 | enum aio_type type; | 20 | enum aio_type type; |
| @@ -65,47 +66,33 @@ static long io_getevents(aio_context_t ctx_id, long min_nr, long nr, | |||
| 65 | static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, | 66 | static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf, |
| 66 | int len, unsigned long long offset, struct aio_context *aio) | 67 | int len, unsigned long long offset, struct aio_context *aio) |
| 67 | { | 68 | { |
| 68 | struct iocb iocb, *iocbp = &iocb; | 69 | struct iocb *iocbp = & ((struct iocb) { |
| 70 | .aio_data = (unsigned long) aio, | ||
| 71 | .aio_fildes = fd, | ||
| 72 | .aio_buf = (unsigned long) buf, | ||
| 73 | .aio_nbytes = len, | ||
| 74 | .aio_offset = offset | ||
| 75 | }); | ||
| 69 | char c; | 76 | char c; |
| 70 | int err; | ||
| 71 | 77 | ||
| 72 | iocb = ((struct iocb) { .aio_data = (unsigned long) aio, | 78 | switch (type) { |
| 73 | .aio_reqprio = 0, | ||
| 74 | .aio_fildes = fd, | ||
| 75 | .aio_buf = (unsigned long) buf, | ||
| 76 | .aio_nbytes = len, | ||
| 77 | .aio_offset = offset, | ||
| 78 | .aio_reserved1 = 0, | ||
| 79 | .aio_reserved2 = 0, | ||
| 80 | .aio_reserved3 = 0 }); | ||
| 81 | |||
| 82 | switch(type){ | ||
| 83 | case AIO_READ: | 79 | case AIO_READ: |
| 84 | iocb.aio_lio_opcode = IOCB_CMD_PREAD; | 80 | iocbp->aio_lio_opcode = IOCB_CMD_PREAD; |
| 85 | err = io_submit(ctx, 1, &iocbp); | ||
| 86 | break; | 81 | break; |
| 87 | case AIO_WRITE: | 82 | case AIO_WRITE: |
| 88 | iocb.aio_lio_opcode = IOCB_CMD_PWRITE; | 83 | iocbp->aio_lio_opcode = IOCB_CMD_PWRITE; |
| 89 | err = io_submit(ctx, 1, &iocbp); | ||
| 90 | break; | 84 | break; |
| 91 | case AIO_MMAP: | 85 | case AIO_MMAP: |
| 92 | iocb.aio_lio_opcode = IOCB_CMD_PREAD; | 86 | iocbp->aio_lio_opcode = IOCB_CMD_PREAD; |
| 93 | iocb.aio_buf = (unsigned long) &c; | 87 | iocbp->aio_buf = (unsigned long) &c; |
| 94 | iocb.aio_nbytes = sizeof(c); | 88 | iocbp->aio_nbytes = sizeof(c); |
| 95 | err = io_submit(ctx, 1, &iocbp); | ||
| 96 | break; | 89 | break; |
| 97 | default: | 90 | default: |
| 98 | printk("Bogus op in do_aio - %d\n", type); | 91 | printk(UM_KERN_ERR "Bogus op in do_aio - %d\n", type); |
| 99 | err = -EINVAL; | 92 | return -EINVAL; |
| 100 | break; | ||
| 101 | } | 93 | } |
| 102 | 94 | ||
| 103 | if(err > 0) | 95 | return (io_submit(ctx, 1, &iocbp) > 0) ? 0 : -errno; |
| 104 | err = 0; | ||
| 105 | else | ||
| 106 | err = -errno; | ||
| 107 | |||
| 108 | return err; | ||
| 109 | } | 96 | } |
| 110 | 97 | ||
| 111 | /* Initialized in an initcall and unchanged thereafter */ | 98 | /* Initialized in an initcall and unchanged thereafter */ |
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index 2d9d2ca39299..e9c143297512 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c | |||
| @@ -194,7 +194,7 @@ int os_unmap_memory(void *addr, int len) | |||
| 194 | #define MADV_REMOVE KERNEL_MADV_REMOVE | 194 | #define MADV_REMOVE KERNEL_MADV_REMOVE |
| 195 | #endif | 195 | #endif |
| 196 | 196 | ||
| 197 | int __init os_drop_memory(void *addr, int length) | 197 | int os_drop_memory(void *addr, int length) |
| 198 | { | 198 | { |
| 199 | int err; | 199 | int err; |
| 200 | 200 | ||
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c index 419b2d5ff6de..4c37b1b1d0b5 100644 --- a/arch/um/os-Linux/user_syms.c +++ b/arch/um/os-Linux/user_syms.c | |||
| @@ -19,10 +19,7 @@ extern void *memmove(void *, const void *, size_t); | |||
| 19 | extern void *memset(void *, int, size_t); | 19 | extern void *memset(void *, int, size_t); |
| 20 | extern int printf(const char *, ...); | 20 | extern int printf(const char *, ...); |
| 21 | 21 | ||
| 22 | /* If they're not defined, the export is included in lib/string.c.*/ | 22 | /* If it's not defined, the export is included in lib/string.c.*/ |
| 23 | #ifdef __HAVE_ARCH_STRLEN | ||
| 24 | EXPORT_SYMBOL(strlen); | ||
| 25 | #endif | ||
| 26 | #ifdef __HAVE_ARCH_STRSTR | 23 | #ifdef __HAVE_ARCH_STRSTR |
| 27 | EXPORT_SYMBOL(strstr); | 24 | EXPORT_SYMBOL(strstr); |
| 28 | #endif | 25 | #endif |
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 098720be019a..d6b3ecd4b77e 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
| @@ -4,7 +4,7 @@ obj-y = bug.o bugs.o checksum.o delay.o fault.o ksyms.o ldt.o ptrace.o \ | |||
| 4 | 4 | ||
| 5 | obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o | 5 | obj-$(CONFIG_MODE_SKAS) += stub.o stub_segv.o |
| 6 | 6 | ||
| 7 | subarch-obj-y = lib/bitops.o lib/semaphore.o | 7 | subarch-obj-y = lib/bitops.o lib/semaphore.o lib/string.o |
| 8 | subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o | 8 | subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o |
| 9 | subarch-obj-$(CONFIG_MODULES) += kernel/module.o | 9 | subarch-obj-$(CONFIG_MODULES) += kernel/module.o |
| 10 | 10 | ||
