Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/sommerfeld_i386mp_1]: src/sys/arch/i386/i386 Avoid copying bits of boot-...
details: https://anonhg.NetBSD.org/src/rev/8bfe74e4bc03
branches: sommerfeld_i386mp_1
changeset: 482476:8bfe74e4bc03
user: sommerfeld <sommerfeld%NetBSD.org@localhost>
date: Sun Dec 30 03:35:02 2001 +0000
description:
Avoid copying bits of boot-time gdt which might not be there.
>From Frank van der Linden
diffstat:
sys/arch/i386/i386/gdt.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 907956813198 -r 8bfe74e4bc03 sys/arch/i386/i386/gdt.c
--- a/sys/arch/i386/i386/gdt.c Sat Dec 29 23:30:58 2001 +0000
+++ b/sys/arch/i386/i386/gdt.c Sun Dec 30 03:35:02 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.22.2.6 2001/12/29 23:31:00 sommerfeld Exp $ */
+/* $NetBSD: gdt.c,v 1.22.2.7 2001/12/30 03:35:02 sommerfeld Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.22.2.6 2001/12/29 23:31:00 sommerfeld Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.22.2.7 2001/12/30 03:35:02 sommerfeld Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -216,7 +216,8 @@
ci->ci_gdt = (union descriptor *)uvm_km_valloc(kernel_map, max_len);
uvm_map_pageable(kernel_map, (vaddr_t)ci->ci_gdt,
(vaddr_t)ci->ci_gdt + min_len, FALSE, FALSE);
- memcpy(ci->ci_gdt, gdt, min_len);
+ memset(ci->ci_gdt, 0, min_len);
+ memcpy(ci->ci_gdt, gdt, NGDT * sizeof(gdt[0]));
setsegment(&ci->ci_gdt[GCPU_SEL].sd, ci, sizeof(struct cpu_info)-1,
SDT_MEMRWA, SEL_KPL, 1, 1);
}
Home |
Main Index |
Thread Index |
Old Index