Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 simplify
details: https://anonhg.NetBSD.org/src/rev/61999dfab9e9
branches: trunk
changeset: 356224:61999dfab9e9
user: maxv <maxv%NetBSD.org@localhost>
date: Sun Sep 10 10:51:13 2017 +0000
description:
simplify
diffstat:
sys/arch/amd64/amd64/gdt.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diffs (49 lines):
diff -r d6e7a586653d -r 61999dfab9e9 sys/arch/amd64/amd64/gdt.c
--- a/sys/arch/amd64/amd64/gdt.c Sun Sep 10 10:13:47 2017 +0000
+++ b/sys/arch/amd64/amd64/gdt.c Sun Sep 10 10:51:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.42 2017/09/06 12:39:18 bouyer Exp $ */
+/* $NetBSD: gdt.c,v 1.43 2017/09/10 10:51:13 maxv Exp $ */
/*
* Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.42 2017/09/06 12:39:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.43 2017/09/10 10:51:13 maxv Exp $");
#include "opt_multiprocessor.h"
#include "opt_xen.h"
@@ -300,12 +300,12 @@
lgdt(struct region_descriptor *desc)
{
paddr_t frames[16];
- int i;
+ size_t i;
vaddr_t va;
/*
- * XXX: Xen even checks descriptors AFTER limit.
- * Zero out last frame after limit if needed.
+ * Xen even checks descriptors AFTER limit. Zero out last frame after
+ * limit if needed.
*/
va = desc->rd_base + desc->rd_limit + 1;
memset((void *)va, 0, roundup(va, PAGE_SIZE) - va);
@@ -315,11 +315,10 @@
* Xen. Mark pages R/O too, otherwise Xen will refuse to use them.
*/
for (i = 0; i < roundup(desc->rd_limit, PAGE_SIZE) >> PAGE_SHIFT; i++) {
- frames[i] = ((paddr_t) xpmap_ptetomach(
- (pt_entry_t *)(desc->rd_base + (i << PAGE_SHIFT)))) >>
+ va = desc->rd_base + (i << PAGE_SHIFT);
+ frames[i] = ((paddr_t)xpmap_ptetomach((pt_entry_t *)va)) >>
PAGE_SHIFT;
- pmap_pte_clearbits(kvtopte(desc->rd_base + (i << PAGE_SHIFT)),
- PG_RW);
+ pmap_pte_clearbits(kvtopte(va), PG_RW);
}
if (HYPERVISOR_set_gdt(frames, (desc->rd_limit + 1) >> 3))
Home |
Main Index |
Thread Index |
Old Index