From owner-p4-projects@FreeBSD.ORG Wed Nov 1 19:45:16 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2C4C16A506; Wed, 1 Nov 2006 19:45:15 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52BF216A4FF for ; Wed, 1 Nov 2006 19:45:15 +0000 (UTC) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5438643D9C for ; Wed, 1 Nov 2006 19:45:08 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA1Jj8GB019772 for ; Wed, 1 Nov 2006 19:45:08 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA1Jj7pr019743 for perforce@freebsd.org; Wed, 1 Nov 2006 19:45:07 GMT (envelope-from marcel@freebsd.org) Date: Wed, 1 Nov 2006 19:45:07 GMT Message-Id: <200611011945.kA1Jj7pr019743@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Cc: Subject: PERFORCE change 108939 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2006 19:45:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=108939 Change 108939 by marcel@marcel_cluster on 2006/11/01 19:44:13 Export efi_status_to_errno(). It's too useful to leep it as a static function in efifs.c. Affected files ... .. //depot/projects/ia64/sys/boot/efi/include/efilib.h#8 edit .. //depot/projects/ia64/sys/boot/efi/libefi/Makefile#14 edit .. //depot/projects/ia64/sys/boot/efi/libefi/efifs.c#14 edit .. //depot/projects/ia64/sys/boot/efi/libefi/errno.c#1 add Differences ... ==== //depot/projects/ia64/sys/boot/efi/include/efilib.h#8 (text+ko) ==== @@ -37,14 +37,14 @@ extern struct devsw efifs_dev; extern struct fs_ops efifs_fsops; +extern struct devsw efinet_dev; extern struct netif_driver efinetif; void *efi_get_table(EFI_GUID *tbl); void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table); +int efi_status_to_errno(EFI_STATUS); time_t efi_time(EFI_TIME *); -EFI_PHYSICAL_ADDRESS efimd_va2pa(EFI_VIRTUAL_ADDRESS); - EFI_STATUS main(int argc, CHAR16 *argv[]); void exit(EFI_STATUS status); ==== //depot/projects/ia64/sys/boot/efi/libefi/Makefile#14 (text+ko) ==== @@ -3,7 +3,7 @@ LIB= efi INTERNALLIB= -SRCS= delay.c efi_console.c efifs.c efinet.c libefi.c module.c time.c +SRCS= delay.c efi_console.c efifs.c efinet.c errno.c libefi.c module.c time.c CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/} ==== //depot/projects/ia64/sys/boot/efi/libefi/efifs.c#14 (text+ko) ==== @@ -55,27 +55,6 @@ static int fs_handle_count; static int -status_to_errno(EFI_STATUS status) -{ - - switch (status) { - case EFI_ACCESS_DENIED: return (EPERM); - case EFI_BUFFER_TOO_SMALL: return (EOVERFLOW); - case EFI_DEVICE_ERROR: return (EIO); - case EFI_INVALID_PARAMETER: return (EINVAL); - case EFI_MEDIA_CHANGED: return (ESTALE); - case EFI_NO_MEDIA: return (ENXIO); - case EFI_NOT_FOUND: return (ENOENT); - case EFI_OUT_OF_RESOURCES: return (ENOMEM); - case EFI_UNSUPPORTED: return (ENODEV); - case EFI_VOLUME_CORRUPTED: return (EIO); - case EFI_VOLUME_FULL: return (ENOSPC); - case EFI_WRITE_PROTECTED: return (EACCES); - } - return (EDOOFUS); -} - -static int efifs_open(const char *upath, struct open_file *f) { struct devdesc *dev = f->f_devdata; @@ -91,12 +70,12 @@ status = BS->HandleProtocol(fs_handles[dev->d_unit], &sfs_guid, (VOID **)&fsif); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); /* Get the root directory. */ status = fsif->OpenVolume(fsif, &root); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); while (*upath == '/') upath++; @@ -134,7 +113,7 @@ free(path); root->Close(root); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); f->f_fsdata = file; return (0); @@ -171,7 +150,7 @@ sz = EFI_BLOCK_SIZE; status = file->Read(file, &sz, bufp); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); if (sz == 0) break; size -= sz; @@ -200,7 +179,7 @@ sz = EFI_BLOCK_SIZE; status = file->Write(file, &sz, bufp); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); if (sz == 0) break; size -= sz; @@ -264,7 +243,7 @@ sz = sizeof(fi); status = file->GetInfo(file, &fi_guid, &sz, &fi); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); sb->st_mode = S_IRUSR | S_IRGRP | S_IROTH; if ((fi.info.Attribute & EFI_FILE_READ_ONLY) == 0) @@ -299,7 +278,7 @@ sz = sizeof(fi); status = file->Read(file, &sz, &fi); if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); if (sz == 0) return (ENOENT); @@ -356,7 +335,7 @@ } } if (EFI_ERROR(status)) - return (status_to_errno(status)); + return (efi_status_to_errno(status)); fs_handle_count = sz / sizeof(EFI_HANDLE); return (0); } @@ -413,7 +392,7 @@ err: sprintf(line, "[--] error %d: unable to obtain information\n", - status_to_errno(status)); + efi_status_to_errno(status)); pager_output(line); } }