lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 May 2008 14:39:52 +0200
From:	Pavel Machek <pavel@...e.cz>
To:	Ingo Molnar <mingo@...e.hu>,
	kernel list <linux-kernel@...r.kernel.org>
Subject: aperture_64: use symbolic constants

Use symbolic constants in aperture_64.c where possible (and make a
comment slightly more helpful).

Signed-off-by: Pavel Machek <pavel@...e.cz>

---
commit 4cc4fa2a3ff78277430201c74580e99bbaf7a1d0
tree 6ceafd1f7c4d020f084e9b96d30619680d393274
parent 033a68acc1817ba2bd9f25c2384e4b0c22ff4288
author Pavel <pavel@....ucw.cz> Mon, 19 May 2008 14:38:59 +0200
committer Pavel <pavel@....ucw.cz> Mon, 19 May 2008 14:38:59 +0200

 arch/x86/kernel/aperture_64.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 479926d..6b3757e 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -263,11 +263,11 @@ void __init early_gart_iommu_check(void)
 		if (!early_is_k8_nb(read_pci_config(0, num, 3, 0x00)))
 			continue;
 
-		ctl = read_pci_config(0, num, 3, 0x90);
+		ctl = read_pci_config(0, num, 3, AMD64_GARTAPERTURECTL);
 		aper_enabled = ctl & 1;
 		aper_order = (ctl >> 1) & 7;
 		aper_size = (32 * 1024 * 1024) << aper_order;
-		aper_base = read_pci_config(0, num, 3, 0x94) & 0x7fff;
+		aper_base = read_pci_config(0, num, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
 		aper_base <<= 25;
 
 		if ((last_aper_order && aper_order != last_aper_order) ||
@@ -303,9 +303,9 @@ void __init early_gart_iommu_check(void)
 		if (!early_is_k8_nb(read_pci_config(0, num, 3, 0x00)))
 			continue;
 
-		ctl = read_pci_config(0, num, 3, 0x90);
+		ctl = read_pci_config(0, num, 3, AMD64_GARTAPERTURECTL);
 		ctl &= ~1;
-		write_pci_config(0, num, 3, 0x90, ctl);
+		write_pci_config(0, num, 3, AMD64_GARTAPERTURECTL, ctl);
 	}
 
 }
@@ -332,9 +332,9 @@ void __init gart_iommu_hole_init(void)
 		iommu_detected = 1;
 		gart_iommu_aperture = 1;
 
-		aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7;
+		aper_order = (read_pci_config(0, num, 3, AMD64_GARTAPERTURECTL) >> 1) & 7;
 		aper_size = (32 * 1024 * 1024) << aper_order;
-		aper_base = read_pci_config(0, num, 3, 0x94) & 0x7fff;
+		aper_base = read_pci_config(0, num, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
 		aper_base <<= 25;
 
 		printk(KERN_INFO "Node %d: aperture @ %Lx size %u MB\n",
@@ -406,11 +406,13 @@ void __init gart_iommu_hole_init(void)
 			continue;
 
 		/*
-		 * Don't enable translation yet. That is done later.
+		 * Don't enable translation yet. That is done later
+		 * by enable_gart_translation.
+		 *
 		 * Assume this BIOS didn't initialise the GART so
 		 * just overwrite all previous bits
 		 */
-		write_pci_config(0, num, 3, 0x90, aper_order<<1);
-		write_pci_config(0, num, 3, 0x94, aper_alloc>>25);
+		write_pci_config(0, num, 3, AMD64_GARTAPERTURECTL, aper_order<<1);
+		write_pci_config(0, num, 3, AMD64_GARTAPERTUREBASE, aper_alloc>>25);
 	}
 }

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists