Module Name: src Committed By: riastradh Date: Mon May 22 16:27:49 UTC 2023
Modified Files: src/sys/arch/arm/arm: efi_runtime.c src/sys/arch/x86/x86: efi_machdep.c src/sys/dev: efi.c src/sys/dev/efi: efi.h Log Message: efi(4): Move error macros to efi.h. PR kern/57076 XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/arm/efi_runtime.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/efi_machdep.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/efi.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/efi/efi.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/arm/efi_runtime.c diff -u src/sys/arch/arm/arm/efi_runtime.c:1.10 src/sys/arch/arm/arm/efi_runtime.c:1.11 --- src/sys/arch/arm/arm/efi_runtime.c:1.10 Sat Oct 15 11:19:23 2022 +++ src/sys/arch/arm/arm/efi_runtime.c Mon May 22 16:27:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efi_runtime.c,v 1.10 2022/10/15 11:19:23 jmcneill Exp $ */ +/* $NetBSD: efi_runtime.c,v 1.11 2023/05/22 16:27:48 riastradh Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "efi.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.10 2022/10/15 11:19:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.11 2023/05/22 16:27:48 riastradh Exp $"); #include <sys/param.h> #include <sys/mutex.h> @@ -45,15 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: efi_runtime. #include <arm/arm/efi_runtime.h> #include <arm/bootconfig.h> -#ifdef _LP64 -#define EFIERR(x) (0x8000000000000000 | x) -#else -#define EFIERR(x) (0x80000000 | x) -#endif - -#define EFI_UNSUPPORTED EFIERR(3) -#define EFI_DEVICE_ERROR EFIERR(7) - static kmutex_t efi_lock; static struct efi_rt *RT; #if BYTE_ORDER == LITTLE_ENDIAN Index: src/sys/arch/x86/x86/efi_machdep.c diff -u src/sys/arch/x86/x86/efi_machdep.c:1.4 src/sys/arch/x86/x86/efi_machdep.c:1.5 --- src/sys/arch/x86/x86/efi_machdep.c:1.4 Sat Dec 24 15:23:02 2022 +++ src/sys/arch/x86/x86/efi_machdep.c Mon May 22 16:27:48 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efi_machdep.c,v 1.4 2022/12/24 15:23:02 andvar Exp $ */ +/* $NetBSD: efi_machdep.c,v 1.5 2023/05/22 16:27:48 riastradh Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.4 2022/12/24 15:23:02 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi_machdep.c,v 1.5 2023/05/22 16:27:48 riastradh Exp $"); #include "efi.h" #include "opt_efi.h" @@ -582,18 +582,6 @@ efi_get_e820memmap(void) #ifdef EFI_RUNTIME /* - * XXX move to sys/dev/efi/efi.h - */ -#ifdef _LP64 -#define EFIERR(x) (0x8000000000000000ul | (x)) -#else -#define EFIERR(x) (0x80000000ul | (x)) -#endif - -#define EFI_UNSUPPORTED EFIERR(3) -#define EFI_DEVICE_ERROR EFIERR(7) - -/* * efi_runtime_init() * * Set up kernel access to EFI runtime services: Index: src/sys/dev/efi.c diff -u src/sys/dev/efi.c:1.5 src/sys/dev/efi.c:1.6 --- src/sys/dev/efi.c:1.5 Mon May 22 16:27:39 2023 +++ src/sys/dev/efi.c Mon May 22 16:27:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efi.c,v 1.5 2023/05/22 16:27:39 riastradh Exp $ */ +/* $NetBSD: efi.c,v 1.6 2023/05/22 16:27:49 riastradh Exp $ */ /*- * Copyright (c) 2021 Jared McNeill <jmcne...@invisible.ca> @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.5 2023/05/22 16:27:39 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.6 2023/05/22 16:27:49 riastradh Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -42,22 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: efi.c,v 1.5 #include <dev/efivar.h> -#ifdef _LP64 -#define EFIERR(x) (0x8000000000000000 | (x)) -#else -#define EFIERR(x) (0x80000000 | (x)) -#endif - -#define EFI_SUCCESS 0 -#define EFI_INVALID_PARAMETER EFIERR(2) -#define EFI_UNSUPPORTED EFIERR(3) -#define EFI_BUFFER_TOO_SMALL EFIERR(5) -#define EFI_DEVICE_ERROR EFIERR(7) -#define EFI_WRITE_PROTECTED EFIERR(8) -#define EFI_OUT_OF_RESOURCES EFIERR(9) -#define EFI_NOT_FOUND EFIERR(14) -#define EFI_SECURITY_VIOLATION EFIERR(26) - #include "ioconf.h" /* Index: src/sys/dev/efi/efi.h diff -u src/sys/dev/efi/efi.h:1.2 src/sys/dev/efi/efi.h:1.3 --- src/sys/dev/efi/efi.h:1.2 Thu Sep 22 14:46:37 2022 +++ src/sys/dev/efi/efi.h Mon May 22 16:27:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: efi.h,v 1.2 2022/09/22 14:46:37 riastradh Exp $ */ +/* $NetBSD: efi.h,v 1.3 2023/05/22 16:27:49 riastradh Exp $ */ /*- * Copyright (c) 2004 Marcel Moolenaar @@ -44,6 +44,22 @@ #define EFIAPI /* empty */ #endif +#ifdef _LP64 +#define EFIERR(x) (0x8000000000000000 | (x)) +#else +#define EFIERR(x) (0x80000000 | (x)) +#endif + +#define EFI_SUCCESS 0 +#define EFI_INVALID_PARAMETER EFIERR(2) +#define EFI_UNSUPPORTED EFIERR(3) +#define EFI_BUFFER_TOO_SMALL EFIERR(5) +#define EFI_DEVICE_ERROR EFIERR(7) +#define EFI_WRITE_PROTECTED EFIERR(8) +#define EFI_OUT_OF_RESOURCES EFIERR(9) +#define EFI_NOT_FOUND EFIERR(14) +#define EFI_SECURITY_VIOLATION EFIERR(26) + enum efi_reset { EFI_RESET_COLD, EFI_RESET_WARM,