diff options
author | Guillem Jover <guillem@hadrons.org> | 2011-09-01 20:24:57 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2011-09-02 20:18:43 +0200 |
commit | 729f452a4ff186ae6990c6a3abd1705f42731343 (patch) | |
tree | cb290458e0ed2715ec39212a6bf002fcd32b68f8 /linux/dev/glue | |
parent | 026f55873b827a14db61e6c2c246c454bb3b7b9f (diff) |
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.
Diffstat (limited to 'linux/dev/glue')
-rw-r--r-- | linux/dev/glue/block.c | 20 | ||||
-rw-r--r-- | linux/dev/glue/misc.c | 22 |
2 files changed, 21 insertions, 21 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index c995638..dfd2ee9 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 98c8248..f25d501 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; |