From 5ddfd7847ae59181a1f8be94e7d9a7c6ed3c985a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 30 Aug 2011 03:09:30 +0200 Subject: Cast host_get_time() arguments to fix warnings * linux/dev/glue/misc.c (do_gettimeofday): Cast arguments to `host_get_time'. --- linux/dev/glue/misc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'linux/dev/glue/misc.c') diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c index d8ca3c24..b4676504 100644 --- a/linux/dev/glue/misc.c +++ b/linux/dev/glue/misc.c @@ -229,7 +229,12 @@ add_blkdev_randomness (int major) void do_gettimeofday (struct timeval *tv) { - host_get_time (1, tv); + /* + * XXX: The first argument should be mach_host_self (), but that's too + * expensive, and the host argument is not used by host_get_time (), + * only checked not to be HOST_NULL. + */ + host_get_time ((host_t) 1, (time_value_t *) tv); } int -- cgit v1.2.3 From 2b4bff9914d57bff600ac70194b8b1aab3485bee Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 31 Aug 2011 00:18:07 +0200 Subject: Fix declarations * device/ds_routines.h (io_done_list): Add variable declaration. (device_io_map): Keep variable declaration and move definition to... * device/ds_routines.c: ... here. * i386/i386/fpu.c: Include (curr_ipl): Remove declaration. (fpintr): Add int unit parameter. * linux/dev/glue/glue.h: New header. * i386/i386/fpu.h (fpintr): Add function prototype. * i386/i386/hardclock.c (clock_interrupt, linux_timer_intr): Remove prototypes. [LINUX_DEV]: Include * i386/i386/ipl.h (curr_ipl): Add declaration. * i386/i386/pic.h (curr_pic_mask, pic_mask, prtnull, intnull): Add declarations. * i386/i386at/kd.h (kdintr): Add declaration. * i386/i386at/pic_isa.c: Include and (intnull, fpintr, hardclock, kdintr, prtnull): Remove prototypes. * i386/xen/xen.c: Include (clock_interrupt): Remove prototype. * linux/dev/arch/i386/kernel/irq.c: Include and (linux_timer_intr, splhigh, spl0, curr_ipl, curr_pic_mask, pic_mask, get_options): Remove declarations. * linux/dev/drivers/block/floppy.c: Include (issig, get_options): Remove declarations. * linux/dev/drivers/block/genhd.c: Include (linux_intr_pri): Remove declaration. * linux/dev/glue/block.c: Include and . (device_io_map, blksize_size): Remove declarations. * linux/dev/glue/kmem.c: Include and (alloc_contig_mem, printf): Remove declarations. * linux/dev/glue/misc.c: Include and (vm_map_lookup_entry, printf): Remove prototypes. * linux/dev/glue/net.c: Include , and . (linux_intr_pri, io_done_list): Remove declarations. * linux/dev/init/main.c: Include and . (phys_last_addr, alloc_contig_mem, free_contig_mem, init_IRQ, restore_IRQ, startrtclock, linux_version_init, linux_kmem_init, pci_init, linux_net_emulation_init, device_setup, linux_printk, linux_timer_intr, spl0, splhigh, form_pic_mask, linux_bad_intr, prtnull, intnull, linux_sched_init, pcmcia_init): Remove declarations. * linux/dev/kernel/sched.c: Include , and . (alloc_contig_mem, free_contig_mem, splhigh, splx, linux_soft_intr, issig, printf, linux_auto_config): Remove prototypes. * linux/dev/kernel/softirq.c: Include . * linux/src/drivers/block/floppy.c: Include . (get_options): Remove prototype. * linux/src/init/main.c: Include (init_IRQ): Remove prototype. --- device/ds_routines.c | 2 ++ device/ds_routines.h | 4 +++- i386/i386/fpu.c | 4 ++-- i386/i386/fpu.h | 1 + i386/i386/hardclock.c | 7 +++---- i386/i386/ipl.h | 1 + i386/i386/pic.h | 4 ++++ i386/i386at/kd.h | 2 ++ i386/i386at/pic_isa.c | 6 +++--- i386/xen/xen.c | 2 +- linux/dev/arch/i386/kernel/irq.c | 13 ++---------- linux/dev/drivers/block/floppy.c | 5 ++--- linux/dev/drivers/block/genhd.c | 3 +-- linux/dev/glue/block.c | 10 ++------- linux/dev/glue/glue.h | 44 ++++++++++++++++++++++++++++++++++++++++ linux/dev/glue/kmem.c | 4 ++-- linux/dev/glue/misc.c | 6 ++---- linux/dev/glue/net.c | 6 ++++-- linux/dev/init/main.c | 26 ++---------------------- linux/dev/kernel/sched.c | 13 ++++-------- linux/dev/kernel/softirq.c | 2 ++ linux/src/drivers/block/floppy.c | 4 ++-- linux/src/init/main.c | 3 ++- 23 files changed, 93 insertions(+), 79 deletions(-) create mode 100644 linux/dev/glue/glue.h (limited to 'linux/dev/glue/misc.c') diff --git a/device/ds_routines.c b/device/ds_routines.c index 2173ddff..d4a08fb1 100644 --- a/device/ds_routines.c +++ b/device/ds_routines.c @@ -130,6 +130,8 @@ static struct device_emulation_ops *emulation_list[] = &mach_device_emulation_ops, }; +vm_map_t device_io_map; + #define NUM_EMULATION (sizeof (emulation_list) / sizeof (emulation_list[0])) io_return_t diff --git a/device/ds_routines.h b/device/ds_routines.h index e1f6aadb..a00a12d5 100644 --- a/device/ds_routines.h +++ b/device/ds_routines.h @@ -41,7 +41,9 @@ /* * Map for device IO memory. */ -vm_map_t device_io_map; +extern vm_map_t device_io_map; + +extern queue_head_t io_done_list; kern_return_t device_read_alloc(io_req_t, vm_size_t); kern_return_t device_write_get(io_req_t, boolean_t *); diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index 2a4b9c09..2626a38f 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -52,12 +52,12 @@ #include #include #include +#include #include #include "cpu_number.h" #if 0 #include -extern int curr_ipl; #define ASSERT_IPL(L) \ { \ if (curr_ipl != L) { \ @@ -865,7 +865,7 @@ fp_state_alloc() * This comes in on line 5 of the slave PIC at SPL1. */ void -fpintr() +fpintr(int unit) { spl_t s; thread_t thread = current_thread(); diff --git a/i386/i386/fpu.h b/i386/i386/fpu.h index 1a1b61f6..21561875 100644 --- a/i386/i386/fpu.h +++ b/i386/i386/fpu.h @@ -124,5 +124,6 @@ extern void fpextovrflt(void); extern void fpexterrflt(void); extern void fpastintr(void); extern void init_fpu(void); +extern void fpintr(int unit); #endif /* _I386_FPU_H_ */ diff --git a/i386/i386/hardclock.c b/i386/i386/hardclock.c index c97feac3..aecd3a30 100644 --- a/i386/i386/hardclock.c +++ b/i386/i386/hardclock.c @@ -39,13 +39,12 @@ #include #endif -extern void clock_interrupt(); -extern char return_to_iret[]; - #ifdef LINUX_DEV -extern void linux_timer_intr(void); +#include #endif +extern char return_to_iret[]; + void hardclock(iunit, old_ipl, ret_addr, regs) int iunit; /* 'unit' number */ diff --git a/i386/i386/ipl.h b/i386/i386/ipl.h index 557cd8df..8f729e1d 100644 --- a/i386/i386/ipl.h +++ b/i386/i386/ipl.h @@ -73,5 +73,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern void (*ivect[])(); extern int iunit[]; extern int intpri[]; +extern spl_t curr_ipl; #endif /* __ASSEMBLER__ */ #endif /* KERNEL */ diff --git a/i386/i386/pic.h b/i386/i386/pic.h index 7a177d86..52f6ec16 100644 --- a/i386/i386/pic.h +++ b/i386/i386/pic.h @@ -179,6 +179,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifndef __ASSEMBLER__ extern void form_pic_mask (void); extern void picinit (void); +extern int curr_pic_mask; +extern int pic_mask[]; +extern void prtnull(int unit); +extern void intnull(int unit); #endif #endif /* _I386_PIC_H_ */ diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h index bc265b08..3f0dfe16 100644 --- a/i386/i386at/kd.h +++ b/i386/i386at/kd.h @@ -740,4 +740,6 @@ extern void kd_slmwd (void *start, int count, int value); extern void kd_slmscu (void *from, void *to, int count); extern void kd_slmscd (void *from, void *to, int count); +extern void kdintr(int vec, int regs); + #endif /* _KD_H_ */ diff --git a/i386/i386at/pic_isa.c b/i386/i386at/pic_isa.c index ef7d84c7..e48fb507 100644 --- a/i386/i386at/pic_isa.c +++ b/i386/i386at/pic_isa.c @@ -27,11 +27,11 @@ #include #include #include - +#include +#include /* These interrupts are always present */ -extern void intnull(), fpintr(), hardclock(), kdintr(); -extern void prtnull(); +extern void hardclock(); void (*ivect[NINTR])() = { /* 00 */ hardclock, /* always */ diff --git a/i386/xen/xen.c b/i386/xen/xen.c index 87a1ed92..a46ee2c6 100644 --- a/i386/xen/xen.c +++ b/i386/xen/xen.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -43,7 +44,6 @@ void hyp_failsafe_c_callback(struct failsafe_callback_regs *regs) { panic("failsafe"); } -extern void clock_interrupt(); extern void return_to_iret; void hypclock_machine_intr(int old_ipl, void *ret_addr, struct i386_interrupt_state *regs, unsigned64_t delta) { diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 7faaa62c..d996c25c 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -47,10 +47,8 @@ #include #include -extern void linux_timer_intr (void); -extern spl_t splhigh (void); -extern spl_t spl0 (void); -extern void form_pic_mask (void); +#include +#include #if 0 /* XXX: This is the way it's done in linux 2.2. GNU Mach currently uses intr_count. It should be made using local_{bh/irq}_count instead (through hardirq_enter/exit) for SMP support. */ @@ -95,12 +93,6 @@ static struct linux_action *irq_action[16] = NULL, NULL, NULL, NULL }; -extern spl_t curr_ipl; -extern int curr_pic_mask; -extern int pic_mask[]; - -extern void intnull (), prtnull (); - /* * Generic interrupt handler for Linux devices. * Set up a fake `struct pt_regs' then call the real handler. @@ -446,7 +438,6 @@ static void show(char * str) int i; unsigned long *stack; int cpu = smp_processor_id(); - extern char *get_options(char *str, int *ints); printk("\n%s, CPU %d:\n", str, cpu); printk("irq: %d [%d %d]\n", diff --git a/linux/dev/drivers/block/floppy.c b/linux/dev/drivers/block/floppy.c index d3fcd6af..d297e617 100644 --- a/linux/dev/drivers/block/floppy.c +++ b/linux/dev/drivers/block/floppy.c @@ -177,6 +177,8 @@ static inline int __get_order(unsigned long size); #include #include /* for the compatibility eject ioctl */ +#include + #ifndef FLOPPY_MOTOR_MASK #define FLOPPY_MOTOR_MASK 0xf0 @@ -437,7 +439,6 @@ static int probing = 0; static volatile int command_status = FD_COMMAND_NONE, fdc_busy = 0; static struct wait_queue *fdc_wait = NULL, *command_done = NULL; #ifdef MACH -extern int issig (void); #define NO_SIGNAL (! issig () || ! interruptible) #else #define NO_SIGNAL (!(current->signal & ~current->blocked) || !interruptible) @@ -4172,8 +4173,6 @@ static void floppy_release_irq_and_dma(void) #ifdef MODULE -extern char *get_options(char *str, int *ints); - char *floppy=NULL; static void parse_floppy_cfg_string(char *cfg) diff --git a/linux/dev/drivers/block/genhd.c b/linux/dev/drivers/block/genhd.c index 68a27d51..84b3792c 100644 --- a/linux/dev/drivers/block/genhd.c +++ b/linux/dev/drivers/block/genhd.c @@ -39,6 +39,7 @@ #ifdef MACH #include +#include #endif #define SYS_IND(p) get_unaligned(&p->sys_ind) @@ -770,8 +771,6 @@ void device_setup(void) struct gendisk *p; int nr=0; #ifdef MACH - extern int linux_intr_pri; - linux_intr_pri = SPL5; #endif diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index f28644ef..c9956383 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -61,6 +61,7 @@ #include #include #include +#include /* TODO. This should be fixed to not be i386 specific. */ #include @@ -78,9 +79,7 @@ #include #include -extern int linux_auto_config; -extern int linux_intr_pri; -extern int linux_to_mach_error (int); +#include /* This task queue is not used in Mach: just for fixing undefined symbols. */ DECLARE_TASK_QUEUE (tq_disk); @@ -193,9 +192,6 @@ int read_ahead[MAX_BLKDEV] = {0, }; This is unused in Mach. It is here to make drivers compile. */ struct wait_queue *wait_for_request = NULL; -/* Map for allocating device memory. */ -extern vm_map_t device_io_map; - /* Initialize block drivers. */ int blk_dev_init () @@ -276,8 +272,6 @@ unregister_blkdev (unsigned major, const char *name) void set_blocksize (kdev_t dev, int size) { - extern int *blksize_size[]; - if (! blksize_size[MAJOR (dev)]) return; diff --git a/linux/dev/glue/glue.h b/linux/dev/glue/glue.h new file mode 100644 index 00000000..5d4f6d88 --- /dev/null +++ b/linux/dev/glue/glue.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 Free Software Foundation + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the program ; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef LINUX_DEV_GLUE_GLUE_H +#define LINUX_DEV_GLUE_GLUE_H + +#include +#include + +extern int linux_auto_config; +extern int linux_intr_pri; + +extern void *alloc_contig_mem (unsigned, unsigned, unsigned, vm_page_t *); +extern void free_contig_mem (vm_page_t); +extern void init_IRQ (void); +extern void restore_IRQ (void); +extern void linux_kmem_init (void); +extern void linux_net_emulation_init (void); +extern void device_setup (void); +extern void linux_timer_intr (void); +extern void linux_bad_intr (int); +extern void linux_sched_init (void); +extern void pcmcia_init (void); +extern void linux_soft_intr (void); +extern int issig (void); +extern int linux_to_mach_error (int); +extern char *get_options(char *str, int *ints); + +#endif /* LINUX_DEV_GLUE_GLUE_H */ diff --git a/linux/dev/glue/kmem.c b/linux/dev/glue/kmem.c index 8c21ce7d..d1784a5e 100644 --- a/linux/dev/glue/kmem.c +++ b/linux/dev/glue/kmem.c @@ -29,6 +29,7 @@ #include #include +#include #include #include @@ -40,8 +41,7 @@ #include -extern void *alloc_contig_mem (unsigned, unsigned, unsigned, vm_page_t *); -extern int printf (const char *, ...); +#include /* Amount of memory to reserve for Linux memory allocator. We reserve 64K chunks to stay within DMA limits. diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c index b4676504..98c8248f 100644 --- a/linux/dev/glue/misc.c +++ b/linux/dev/glue/misc.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -66,10 +67,7 @@ #include #include #include - -extern boolean_t vm_map_lookup_entry (register vm_map_t, register vm_offset_t, - vm_map_entry_t *); -extern int printf (const char *, ...); +#include int (*dispatch_scsi_info_ptr) (int ino, char *buffer, char **start, off_t offset, int length, int inout) = 0; diff --git a/linux/dev/glue/net.c b/linux/dev/glue/net.c index acb31ae7..91ebf969 100644 --- a/linux/dev/glue/net.c +++ b/linux/dev/glue/net.c @@ -69,6 +69,8 @@ #include #include +#include + #include #include @@ -84,6 +86,7 @@ #include #include #include +#include #define MACH_INCLUDE #include @@ -97,7 +100,7 @@ #include #include -extern int linux_intr_pri; +#include /* One of these is associated with each instance of a device. */ struct net_data @@ -248,7 +251,6 @@ void dev_kfree_skb (struct sk_buff *skb, int mode) { unsigned flags; - extern void *io_done_list; /* Queue sk_buff on done list if there is a page list attached or we need to send a reply. diff --git a/linux/dev/init/main.c b/linux/dev/init/main.c index 9ed35d3d..3a889832 100644 --- a/linux/dev/init/main.c +++ b/linux/dev/init/main.c @@ -39,6 +39,7 @@ #include #include #include +#include #define MACH_INCLUDE #include @@ -47,6 +48,7 @@ #include #include #include +#include #include #include @@ -83,30 +85,6 @@ struct drive_info_struct */ static void calibrate_delay (void); -extern vm_offset_t phys_last_addr; - -extern void *alloc_contig_mem (unsigned, unsigned, unsigned, vm_page_t *); -extern void free_contig_mem (vm_page_t); -extern void init_IRQ (void); -extern void restore_IRQ (void); -extern void startrtclock (void); -extern void linux_version_init (void); -extern void linux_kmem_init (void); -extern unsigned long pci_init (unsigned long, unsigned long); -extern void linux_net_emulation_init (void); -extern void device_setup (void); -extern void linux_printk (char *,...); -extern int linux_timer_intr (void); -extern spl_t spl0 (void); -extern spl_t splhigh (void); -extern void form_pic_mask (void); -extern int linux_bad_intr (int); -extern int prtnull (); -extern int intnull (); -extern void linux_sched_init (void); -extern void pcmcia_init (void); - - /* * Amount of contiguous memory to allocate for initialization. */ diff --git a/linux/dev/kernel/sched.c b/linux/dev/kernel/sched.c index 7b5c5e43..0d2567f3 100644 --- a/linux/dev/kernel/sched.c +++ b/linux/dev/kernel/sched.c @@ -34,6 +34,9 @@ #include #include +#include + +#include #define MACH_INCLUDE #include @@ -41,21 +44,13 @@ #include #include #include +#include #include #include int securelevel = 0; -extern void *alloc_contig_mem (unsigned, unsigned, unsigned, vm_page_t *); -extern void free_contig_mem (vm_page_t); -extern spl_t splhigh (void); -extern spl_t splx (spl_t); -extern void linux_soft_intr (void); -extern int issig (void); -extern int printf (const char *, ...); -extern int linux_auto_config; - static void timer_bh (void); DECLARE_TASK_QUEUE (tq_timer); diff --git a/linux/dev/kernel/softirq.c b/linux/dev/kernel/softirq.c index 96102a7a..65a0962f 100644 --- a/linux/dev/kernel/softirq.c +++ b/linux/dev/kernel/softirq.c @@ -13,6 +13,8 @@ #include #include +#include + int bh_mask_count[32]; unsigned long bh_active = 0; unsigned long bh_mask = 0; diff --git a/linux/src/drivers/block/floppy.c b/linux/src/drivers/block/floppy.c index 0314a0b7..1b96c44f 100644 --- a/linux/src/drivers/block/floppy.c +++ b/linux/src/drivers/block/floppy.c @@ -177,6 +177,8 @@ static inline int __get_order(unsigned long size); #include #include /* for the compatibility eject ioctl */ +#include + #ifndef FLOPPY_MOTOR_MASK #define FLOPPY_MOTOR_MASK 0xf0 @@ -4167,8 +4169,6 @@ static void floppy_release_irq_and_dma(void) #ifdef MODULE -extern char *get_options(char *str, int *ints); - char *floppy=NULL; static void parse_floppy_cfg_string(char *cfg) diff --git a/linux/src/init/main.c b/linux/src/init/main.c index d41ec60c..1aa15b97 100644 --- a/linux/src/init/main.c +++ b/linux/src/init/main.c @@ -42,6 +42,8 @@ #include +#include + /* * Versions of gcc older than that listed below may actually compile * and link okay, but the end product can have subtle run time bugs. @@ -64,7 +66,6 @@ extern int bdflush(void *); extern int kswapd(void *); extern void kswapd_setup(void); -extern void init_IRQ(void); extern void init_modules(void); extern long console_init(long, long); extern long kmalloc_init(long,long); -- cgit v1.2.3 From 729f452a4ff186ae6990c6a3abd1705f42731343 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 1 Sep 2011 20:24:57 +0200 Subject: Do not remap errno codes from E* to LINUX_E* Mach no longer uses any of the old and clashing errno E* codes, so it's safe to use them now w/o namespacing. This also means one less modification needed to the Linux code. * linux/dev/include/asm-i386/errno.h: Remove file. * linux/dev/kernel/dma.c (notifier_chain_unregister) [MACH_INCLUDE]: Remove code. * linux/dev/include/linux/notifier.h: Likewise. * linux/dev/arch/i386/kernel/irq.c (setup_x86_irq): Rename LINUX_EBUSY to EBUSY. (request_irq): Rename LINUX_EINVAL to EINVAL. * linux/dev/glue/block.c (register_blkdev): Rename LINUX_EBUSY to EBUSY and LINUX_EINVAL to EINVAL. (unregister_blkdev): Rename LINUX_EINVAL to EINVAL. (rdwr_partial) Rename LINUX_ENOMEM to ENOMEM and LINUX_EIO to EIO. * linux/dev/glue/misc.c (linux_to_mach_error): Rename LINUX_EPERM to EPERM, LINUX_EIO to EIO, LINUX_ENXIO to ENXIO, LINUX_EACCES to EACCES, LINUX_EFAULT to EFAULT, LINUX_EBUSY to EBUSY, LINUX_EINVAL to EINVAL, LINUX_EROFS to EROFS, LINUX_EWOULDBLOCK to EWOULDBLOCK and LINUX_ENOMEM to ENOMEM. (verify_area): Rename LINUX_EFAULT to EFAULT. * linux/dev/kernel/resource.c (check_region): Rename LINUX_EBUSY to EBUSY. * linux/dev/kernel/sched.c (__do_down): Rename LINUX_EINTR to EINTR. --- linux/dev/arch/i386/kernel/irq.c | 10 +- linux/dev/glue/block.c | 20 +-- linux/dev/glue/misc.c | 22 +-- linux/dev/include/asm-i386/errno.h | 266 ------------------------------------- linux/dev/include/linux/notifier.h | 4 - linux/dev/kernel/dma.c | 4 +- linux/dev/kernel/resource.c | 2 +- linux/dev/kernel/sched.c | 4 +- 8 files changed, 31 insertions(+), 301 deletions(-) delete mode 100644 linux/dev/include/asm-i386/errno.h (limited to 'linux/dev/glue/misc.c') diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index d996c25c..41bdaa3c 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -215,15 +215,15 @@ setup_x86_irq (int irq, struct linux_action *new) { /* Can't share interrupts unless both agree to */ if (!(old->flags & new->flags & SA_SHIRQ)) - return (-LINUX_EBUSY); + return (-EBUSY); /* Can't share interrupts unless both are same type */ if ((old->flags ^ new->flags) & SA_INTERRUPT) - return (-LINUX_EBUSY); + return (-EBUSY); /* Can't share at different levels */ if (intpri[irq] && linux_intr_pri != intpri[irq]) - return (-LINUX_EBUSY); + return (-EBUSY); /* add new interrupt at end of irq queue */ do @@ -263,7 +263,7 @@ request_irq (unsigned int irq, void (*handler) (int, void *, struct pt_regs *), assert (irq < 16); if (!handler) - return -LINUX_EINVAL; + return -EINVAL; /* * Hmm... Should I use `kalloc()' ? @@ -272,7 +272,7 @@ request_irq (unsigned int irq, void (*handler) (int, void *, struct pt_regs *), action = (struct linux_action *) linux_kmalloc (sizeof (struct linux_action), GFP_KERNEL); if (action == NULL) - return -LINUX_ENOMEM; + return -ENOMEM; action->handler = handler; action->next = NULL; diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index c9956383..dfd2ee98 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -231,12 +231,12 @@ register_blkdev (unsigned major, const char *name, for (major = MAX_BLKDEV - 1; major > 0; major--) if (blkdevs[major].fops == NULL) goto out; - return -LINUX_EBUSY; + return -EBUSY; } if (major >= MAX_BLKDEV) - return -LINUX_EINVAL; + return -EINVAL; if (blkdevs[major].fops && blkdevs[major].fops != fops) - return -LINUX_EBUSY; + return -EBUSY; out: blkdevs[major].name = name; @@ -255,9 +255,9 @@ int unregister_blkdev (unsigned major, const char *name) { if (major >= MAX_BLKDEV) - return -LINUX_EINVAL; + return -EINVAL; if (! blkdevs[major].fops || strcmp (blkdevs[major].name, name)) - return -LINUX_EINVAL; + return -EINVAL; blkdevs[major].fops = NULL; if (blkdevs[major].labels) { @@ -525,7 +525,7 @@ rdwr_partial (int rw, kdev_t dev, loff_t *off, } bh->b_data = alloc_buffer (bh->b_size); if (! bh->b_data) - return -LINUX_ENOMEM; + return -ENOMEM; ll_rw_block (READ, 1, &bh); wait_on_buffer (bh); if (buffer_uptodate (bh)) @@ -544,7 +544,7 @@ rdwr_partial (int rw, kdev_t dev, loff_t *off, wait_on_buffer (bh); if (! buffer_uptodate (bh)) { - err = -LINUX_EIO; + err = -EIO; goto out; } } @@ -553,7 +553,7 @@ rdwr_partial (int rw, kdev_t dev, loff_t *off, *off += c; } else - err = -LINUX_EIO; + err = -EIO; out: free_buffer (bh->b_data, bh->b_size); return err; @@ -606,7 +606,7 @@ rdwr_full (int rw, kdev_t dev, loff_t *off, char **buf, int *resid, int bshift) bh->b_data = alloc_buffer (cc); if (! bh->b_data) { - err = -LINUX_ENOMEM; + err = -ENOMEM; break; } if (rw == WRITE) @@ -630,7 +630,7 @@ rdwr_full (int rw, kdev_t dev, loff_t *off, char **buf, int *resid, int bshift) && rw == READ && test_bit (BH_Bounce, &bh->b_state)) memcpy (*buf + cc, bh->b_data, bh->b_size); else if (! err && ! buffer_uptodate (bh)) - err = -LINUX_EIO; + err = -EIO; if (test_bit (BH_Bounce, &bh->b_state)) free_buffer (bh->b_data, bh->b_size); } diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c index 98c8248f..f25d501b 100644 --- a/linux/dev/glue/misc.c +++ b/linux/dev/glue/misc.c @@ -82,34 +82,34 @@ linux_to_mach_error (int err) case 0: return D_SUCCESS; - case -LINUX_EPERM: + case -EPERM: return D_INVALID_OPERATION; - case -LINUX_EIO: + case -EIO: return D_IO_ERROR; - case -LINUX_ENXIO: + case -ENXIO: return D_NO_SUCH_DEVICE; - case -LINUX_EACCES: + case -EACCES: return D_INVALID_OPERATION; - case -LINUX_EFAULT: + case -EFAULT: return D_INVALID_SIZE; - case -LINUX_EBUSY: + case -EBUSY: return D_ALREADY_OPEN; - case -LINUX_EINVAL: + case -EINVAL: return D_INVALID_SIZE; - case -LINUX_EROFS: + case -EROFS: return D_READ_ONLY; - case -LINUX_EWOULDBLOCK: + case -EWOULDBLOCK: return D_WOULD_BLOCK; - case -LINUX_ENOMEM: + case -ENOMEM: return D_NO_MEMORY; default: @@ -146,7 +146,7 @@ verify_area (int rw, const void *p, unsigned long size) || (entry->protection & prot) != prot) { vm_map_unlock_read (current_map ()); - return -LINUX_EFAULT; + return -EFAULT; } if (entry->vme_end - entry->vme_start >= len) break; diff --git a/linux/dev/include/asm-i386/errno.h b/linux/dev/include/asm-i386/errno.h deleted file mode 100644 index 1683367a..00000000 --- a/linux/dev/include/asm-i386/errno.h +++ /dev/null @@ -1,266 +0,0 @@ -#ifndef _I386_ERRNO_H -#define _I386_ERRNO_H - -#ifdef MACH_INCLUDE - -#define LINUX_EPERM 1 /* Operation not permitted */ -#define LINUX_ENOENT 2 /* No such file or directory */ -#define LINUX_ESRCH 3 /* No such process */ -#define LINUX_EINTR 4 /* Interrupted system call */ -#define LINUX_EIO 5 /* I/O error */ -#define LINUX_ENXIO 6 /* No such device or address */ -#define LINUX_E2BIG 7 /* Arg list too long */ -#define LINUX_ENOEXEC 8 /* Exec format error */ -#define LINUX_EBADF 9 /* Bad file number */ -#define LINUX_ECHILD 10 /* No child processes */ -#define LINUX_EAGAIN 11 /* Try again */ -#define LINUX_ENOMEM 12 /* Out of memory */ -#define LINUX_EACCES 13 /* Permission denied */ -#define LINUX_EFAULT 14 /* Bad address */ -#define LINUX_ENOTBLK 15 /* Block device required */ -#define LINUX_EBUSY 16 /* Device or resource busy */ -#define LINUX_EEXIST 17 /* File exists */ -#define LINUX_EXDEV 18 /* Cross-device link */ -#define LINUX_ENODEV 19 /* No such device */ -#define LINUX_ENOTDIR 20 /* Not a directory */ -#define LINUX_EISDIR 21 /* Is a directory */ -#define LINUX_EINVAL 22 /* Invalid argument */ -#define LINUX_ENFILE 23 /* File table overflow */ -#define LINUX_EMFILE 24 /* Too many open files */ -#define LINUX_ENOTTY 25 /* Not a typewriter */ -#define LINUX_ETXTBSY 26 /* Text file busy */ -#define LINUX_EFBIG 27 /* File too large */ -#define LINUX_ENOSPC 28 /* No space left on device */ -#define LINUX_ESPIPE 29 /* Illegal seek */ -#define LINUX_EROFS 30 /* Read-only file system */ -#define LINUX_EMLINK 31 /* Too many links */ -#define LINUX_EPIPE 32 /* Broken pipe */ -#define LINUX_EDOM 33 /* Math argument out of domain of func */ -#define LINUX_ERANGE 34 /* Math result not representable */ -#define LINUX_EDEADLK 35 /* Resource deadlock would occur */ -#define LINUX_ENAMETOOLONG 36 /* File name too long */ -#define LINUX_ENOLCK 37 /* No record locks available */ -#define LINUX_ENOSYS 38 /* Function not implemented */ -#define LINUX_ENOTEMPTY 39 /* Directory not empty */ -#define LINUX_ELOOP 40 /* Too many symbolic links encountered */ -#define LINUX_EWOULDBLOCK LINUX_EAGAIN /* Operation would block */ -#define LINUX_ENOMSG 42 /* No message of desired type */ -#define LINUX_EIDRM 43 /* Identifier removed */ -#define LINUX_ECHRNG 44 /* Channel number out of range */ -#define LINUX_EL2NSYNC 45 /* Level 2 not synchronized */ -#define LINUX_EL3HLT 46 /* Level 3 halted */ -#define LINUX_EL3RST 47 /* Level 3 reset */ -#define LINUX_ELNRNG 48 /* Link number out of range */ -#define LINUX_EUNATCH 49 /* Protocol driver not attached */ -#define LINUX_ENOCSI 50 /* No CSI structure available */ -#define LINUX_EL2HLT 51 /* Level 2 halted */ -#define LINUX_EBADE 52 /* Invalid exchange */ -#define LINUX_EBADR 53 /* Invalid request descriptor */ -#define LINUX_EXFULL 54 /* Exchange full */ -#define LINUX_ENOANO 55 /* No anode */ -#define LINUX_EBADRQC 56 /* Invalid request code */ -#define LINUX_EBADSLT 57 /* Invalid slot */ - -#define LINUX_EDEADLOCK LINUX_EDEADLK - -#define LINUX_EBFONT 59 /* Bad font file format */ -#define LINUX_ENOSTR 60 /* Device not a stream */ -#define LINUX_ENODATA 61 /* No data available */ -#define LINUX_ETIME 62 /* Timer expired */ -#define LINUX_ENOSR 63 /* Out of streams resources */ -#define LINUX_ENONET 64 /* Machine is not on the network */ -#define LINUX_ENOPKG 65 /* Package not installed */ -#define LINUX_EREMOTE 66 /* Object is remote */ -#define LINUX_ENOLINK 67 /* Link has been severed */ -#define LINUX_EADV 68 /* Advertise error */ -#define LINUX_ESRMNT 69 /* Srmount error */ -#define LINUX_ECOMM 70 /* Communication error on send */ -#define LINUX_EPROTO 71 /* Protocol error */ -#define LINUX_EMULTIHOP 72 /* Multihop attempted */ -#define LINUX_EDOTDOT 73 /* RFS specific error */ -#define LINUX_EBADMSG 74 /* Not a data message */ -#define LINUX_EOVERFLOW 75 /* Value too large for defined data type */ -#define LINUX_ENOTUNIQ 76 /* Name not unique on network */ -#define LINUX_EBADFD 77 /* File descriptor in bad state */ -#define LINUX_EREMCHG 78 /* Remote address changed */ -#define LINUX_ELIBACC 79 /* Can not access a needed shared library */ -#define LINUX_ELIBBAD 80 /* Accessing a corrupted shared library */ -#define LINUX_ELIBSCN 81 /* .lib section in a.out corrupted */ -#define LINUX_ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define LINUX_ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define LINUX_EILSEQ 84 /* Illegal byte sequence */ -#define LINUX_ERESTART 85 /* Interrupted system call should be restarted */ -#define LINUX_ESTRPIPE 86 /* Streams pipe error */ -#define LINUX_EUSERS 87 /* Too many users */ -#define LINUX_ENOTSOCK 88 /* Socket operation on non-socket */ -#define LINUX_EDESTADDRREQ 89 /* Destination address required */ -#define LINUX_EMSGSIZE 90 /* Message too long */ -#define LINUX_EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define LINUX_ENOPROTOOPT 92 /* Protocol not available */ -#define LINUX_EPROTONOSUPPORT 93 /* Protocol not supported */ -#define LINUX_ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define LINUX_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define LINUX_EPFNOSUPPORT 96 /* Protocol family not supported */ -#define LINUX_EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define LINUX_EADDRINUSE 98 /* Address already in use */ -#define LINUX_EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define LINUX_ENETDOWN 100 /* Network is down */ -#define LINUX_ENETUNREACH 101 /* Network is unreachable */ -#define LINUX_ENETRESET 102 /* Network dropped connection because of reset */ -#define LINUX_ECONNABORTED 103 /* Software caused connection abort */ -#define LINUX_ECONNRESET 104 /* Connection reset by peer */ -#define LINUX_ENOBUFS 105 /* No buffer space available */ -#define LINUX_EISCONN 106 /* Transport endpoint is already connected */ -#define LINUX_ENOTCONN 107 /* Transport endpoint is not connected */ -#define LINUX_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define LINUX_ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define LINUX_ETIMEDOUT 110 /* Connection timed out */ -#define LINUX_ECONNREFUSED 111 /* Connection refused */ -#define LINUX_EHOSTDOWN 112 /* Host is down */ -#define LINUX_EHOSTUNREACH 113 /* No route to host */ -#define LINUX_EALREADY 114 /* Operation already in progress */ -#define LINUX_EINPROGRESS 115 /* Operation now in progress */ -#define LINUX_ESTALE 116 /* Stale NFS file handle */ -#define LINUX_EUCLEAN 117 /* Structure needs cleaning */ -#define LINUX_ENOTNAM 118 /* Not a XENIX named type file */ -#define LINUX_ENAVAIL 119 /* No XENIX semaphores available */ -#define LINUX_EISNAM 120 /* Is a named type file */ -#define LINUX_EREMOTEIO 121 /* Remote I/O error */ -#define LINUX_EDQUOT 122 /* Quota exceeded */ - -#define LINUX_ENOMEDIUM 123 /* No medium found */ -#define LINUX_EMEDIUMTYPE 124 /* Wrong medium type */ - -#else /* !MACH_INCLUDE */ - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ - -#endif /* !MACH_INCLUDE */ - -#endif diff --git a/linux/dev/include/linux/notifier.h b/linux/dev/include/linux/notifier.h index eede20f0..b3c9ccf6 100644 --- a/linux/dev/include/linux/notifier.h +++ b/linux/dev/include/linux/notifier.h @@ -55,11 +55,7 @@ extern __inline__ int notifier_chain_unregister(struct notifier_block **nl, stru } nl=&((*nl)->next); } -#ifdef MACH_INCLUDE - return -LINUX_ENOENT; -#else return -ENOENT; -#endif } /* diff --git a/linux/dev/kernel/dma.c b/linux/dev/kernel/dma.c index 4b569780..bbda4bbf 100644 --- a/linux/dev/kernel/dma.c +++ b/linux/dev/kernel/dma.c @@ -80,10 +80,10 @@ int request_dma (unsigned int dmanr, const char *device_id) { if (dmanr >= MAX_DMA_CHANNELS) - return -LINUX_EINVAL; + return -EINVAL; if (xchg (&dma_chan_busy[dmanr].lock, 1) != 0) - return -LINUX_EBUSY; + return -EBUSY; dma_chan_busy[dmanr].device_id = device_id; diff --git a/linux/dev/kernel/resource.c b/linux/dev/kernel/resource.c index 7a187552..ba107e8e 100644 --- a/linux/dev/kernel/resource.c +++ b/linux/dev/kernel/resource.c @@ -131,7 +131,7 @@ release_region (unsigned int from, unsigned int num) int check_region (unsigned int from, unsigned int num) { - return (find_gap (&iolist, from, num) == NULL) ? -LINUX_EBUSY : 0; + return (find_gap (&iolist, from, num) == NULL) ? -EBUSY : 0; } /* Called from init/main.c to reserve IO ports. */ diff --git a/linux/dev/kernel/sched.c b/linux/dev/kernel/sched.c index 0d2567f3..87906a45 100644 --- a/linux/dev/kernel/sched.c +++ b/linux/dev/kernel/sched.c @@ -160,7 +160,7 @@ __do_down (struct semaphore *sem, int task_state) if (task_state == TASK_INTERRUPTIBLE && issig ()) { - ret = -LINUX_EINTR; + ret = -EINTR; atomic_inc (&sem->count); break; } @@ -180,7 +180,7 @@ __do_down (struct semaphore *sem, int task_state) { if (task_state == TASK_INTERRUPTIBLE && issig ()) { - ret = -LINUX_EINTR; + ret = -EINTR; atomic_inc (&sem->count); break; } -- cgit v1.2.3 From 7effecf87173a122c95427dafa971abbbdba3493 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 24 Mar 2012 02:47:20 +0100 Subject: Fix issig crash at boot * linux/dev/glue/misc.c (issig): Return 0 if current_thread() is NULL. --- linux/dev/glue/misc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/dev/glue/misc.c') diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c index f25d501b..77dc31dd 100644 --- a/linux/dev/glue/misc.c +++ b/linux/dev/glue/misc.c @@ -121,6 +121,8 @@ linux_to_mach_error (int err) int issig () { + if (!current_thread()) + return 0; return current_thread ()->wait_result != THREAD_AWAKENED; } -- cgit v1.2.3