Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/dev allocate msgbuf with kmem_zalloc inste...
details: https://anonhg.NetBSD.org/src/rev/715fd7d9fa39
branches: trunk
changeset: 772037:715fd7d9fa39
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Dec 15 02:09:15 2011 +0000
description:
allocate msgbuf with kmem_zalloc instead of thunk_malloc, now dmesg works
diffstat:
sys/arch/usermode/dev/cpu.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diffs (53 lines):
diff -r 6b122dc5e946 -r 715fd7d9fa39 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c Thu Dec 15 01:30:04 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c Thu Dec 15 02:09:15 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.53 2011/12/15 00:40:03 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.54 2011/12/15 02:09:15 jmcneill Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
#include "opt_hz.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.53 2011/12/15 00:40:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.54 2011/12/15 02:09:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -42,6 +42,7 @@
#include <sys/cpu.h>
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
+#include <sys/kmem.h>
#include <dev/cons.h>
@@ -78,7 +79,7 @@
} cpu_softc_t;
static struct pcb lwp0pcb;
-static void *msgbuf;
+static void *um_msgbuf;
CFATTACH_DECL_NEW(cpu, sizeof(cpu_softc_t), cpu_match, cpu_attach, NULL, NULL);
@@ -374,13 +375,13 @@
void
cpu_startup(void)
{
- size_t stacksize;
+ size_t stacksize, msgbufsize = 32 * 1024;
void *stack_pagefault_ucp;
- msgbuf = thunk_malloc(PAGE_SIZE);
- if (msgbuf == NULL)
+ um_msgbuf = kmem_zalloc(msgbufsize, KM_SLEEP);
+ if (um_msgbuf == NULL)
panic("couldn't allocate msgbuf");
- initmsgbuf(msgbuf, PAGE_SIZE);
+ initmsgbuf(um_msgbuf, msgbufsize);
banner();
Home |
Main Index |
Thread Index |
Old Index