Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/acpi Cast physical addresses via uintptr_t to A...



details:   https://anonhg.NetBSD.org/src/rev/42123ef56f8d
branches:  trunk
changeset: 965308:42123ef56f8d
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Sep 12 14:28:08 2019 +0000

description:
Cast physical addresses via uintptr_t to ACPI_PHYSICAL_ADDRESS to deal
with all size variants of the types used here in different builds.
Patch from manu@.

diffstat:

 sys/arch/x86/acpi/acpi_machdep.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r 99f86bdb1856 -r 42123ef56f8d sys/arch/x86/acpi/acpi_machdep.c
--- a/sys/arch/x86/acpi/acpi_machdep.c  Thu Sep 12 12:25:46 2019 +0000
+++ b/sys/arch/x86/acpi/acpi_machdep.c  Thu Sep 12 14:28:08 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.27 2019/09/12 00:52:22 manu Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.27 2019/09/12 00:52:22 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.28 2019/09/12 14:28:08 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -126,8 +126,8 @@
                for (i = 0; i < info->cfg.nent; i++) {
                        if (memcmp(&ct[i].ct_uuid,
                            &EFI_UUID_ACPI20, sizeof(EFI_UUID_ACPI20)) == 0) {
-                               PhysicalAddress =
-                                   (ACPI_PHYSICAL_ADDRESS)ct[i].ct_data;
+                               PhysicalAddress = (ACPI_PHYSICAL_ADDRESS)
+                                   (uintptr_t)ct[i].ct_data;
                                if (PhysicalAddress)
                                        goto out;
                                        
@@ -137,8 +137,8 @@
                for (i = 0; i < info->cfg.nent; i++) {
                        if (memcmp(&ct[i].ct_uuid,
                            &EFI_UUID_ACPI10, sizeof(EFI_UUID_ACPI10)) == 0) {
-                               PhysicalAddress =
-                                   (ACPI_PHYSICAL_ADDRESS)ct[i].ct_data;
+                               PhysicalAddress = (ACPI_PHYSICAL_ADDRESS)
+                                   (uintptr_t)ct[i].ct_data;
                                if (PhysicalAddress)
                                        goto out;
                                        



Home | Main Index | Thread Index | Old Index