Source-Changes-HG archive

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

[src/trunk]: src/sys/arch malloc(9) -> kmem(9)



details:   https://anonhg.NetBSD.org/src/rev/7365c7b6f113
branches:  trunk
changeset: 957198:7365c7b6f113
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Nov 21 17:22:03 2020 +0000

description:
malloc(9) -> kmem(9)

diffstat:

 sys/arch/sh3/dev/sci.c     |   8 ++++----
 sys/arch/sh3/dev/scif.c    |   8 ++++----
 sys/arch/zaurus/dev/w100.c |   8 ++++----
 sys/arch/zaurus/dev/zkbd.c |  14 +++++++-------
 4 files changed, 19 insertions(+), 19 deletions(-)

diffs (148 lines):

diff -r f5878bca7f20 -r 7365c7b6f113 sys/arch/sh3/dev/sci.c
--- a/sys/arch/sh3/dev/sci.c    Sat Nov 21 17:18:36 2020 +0000
+++ b/sys/arch/sh3/dev/sci.c    Sat Nov 21 17:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sci.c,v 1.62 2019/11/10 21:16:32 chs Exp $ */
+/* $NetBSD: sci.c,v 1.63 2020/11/21 17:25:52 thorpej Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.62 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sci.c,v 1.63 2020/11/21 17:25:52 thorpej Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_sci.h"
@@ -107,7 +107,7 @@
 #include <sys/syslog.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/kauth.h>
 #include <sys/intr.h>
 
@@ -416,7 +416,7 @@
        tp->t_hwiflow = NULL;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(sci_rbuf_size << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(sci_rbuf_size << 1, KM_SLEEP);
        sc->sc_ebuf = sc->sc_rbuf + (sci_rbuf_size << 1);
 
        tty_attach(tp);
diff -r f5878bca7f20 -r 7365c7b6f113 sys/arch/sh3/dev/scif.c
--- a/sys/arch/sh3/dev/scif.c   Sat Nov 21 17:18:36 2020 +0000
+++ b/sys/arch/sh3/dev/scif.c   Sat Nov 21 17:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scif.c,v 1.67 2019/11/10 21:16:32 chs Exp $ */
+/*     $NetBSD: scif.c,v 1.68 2020/11/21 17:25:52 thorpej Exp $ */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.67 2019/11/10 21:16:32 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.68 2020/11/21 17:25:52 thorpej Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_scif.h"
@@ -107,7 +107,7 @@
 #include <sys/syslog.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/kgdb.h>
 #include <sys/kauth.h>
 #include <sys/intr.h>
@@ -497,7 +497,7 @@
        tp->t_hwiflow = NULL;
 
        sc->sc_tty = tp;
-       sc->sc_rbuf = malloc(scif_rbuf_size << 1, M_DEVBUF, M_WAITOK);
+       sc->sc_rbuf = kmem_alloc(scif_rbuf_size << 1, KM_SLEEP);
        sc->sc_ebuf = sc->sc_rbuf + (scif_rbuf_size << 1);
 
        tty_attach(tp);
diff -r f5878bca7f20 -r 7365c7b6f113 sys/arch/zaurus/dev/w100.c
--- a/sys/arch/zaurus/dev/w100.c        Sat Nov 21 17:18:36 2020 +0000
+++ b/sys/arch/zaurus/dev/w100.c        Sat Nov 21 17:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: w100.c,v 1.2 2019/11/10 21:16:34 chs Exp $ */
+/* $NetBSD: w100.c,v 1.3 2020/11/21 17:22:03 thorpej Exp $ */
 /*
  * Copyright (c) 2002, 2003  Genetec Corporation.  All rights reserved.
  * Written by Hiroyuki Bessho for Genetec Corporation.
@@ -28,13 +28,13 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: w100.c,v 1.2 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: w100.c,v 1.3 2020/11/21 17:22:03 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
 #include <sys/uio.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/kernel.h>                        /* for cold */
 
 #include <uvm/uvm_extern.h>
@@ -235,7 +235,7 @@
        struct w100_screen *scr = NULL;
        int error = 0;
 
-       scr = malloc(sizeof(*scr), M_DEVBUF, M_WAITOK | M_ZERO);
+       scr = kmem_zalloc(sizeof(*scr), KM_SLEEP);
        scr->buf_va = (u_char *)bus_space_vaddr(sc->iot, sc->ioh_vram);
        scr->depth = depth;
 
diff -r f5878bca7f20 -r 7365c7b6f113 sys/arch/zaurus/dev/zkbd.c
--- a/sys/arch/zaurus/dev/zkbd.c        Sat Nov 21 17:18:36 2020 +0000
+++ b/sys/arch/zaurus/dev/zkbd.c        Sat Nov 21 17:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zkbd.c,v 1.19 2019/11/10 21:16:34 chs Exp $    */
+/*     $NetBSD: zkbd.c,v 1.20 2020/11/21 17:22:03 thorpej Exp $        */
 /* $OpenBSD: zaurus_kbd.c,v 1.28 2005/12/21 20:36:03 deraadt Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zkbd.c,v 1.19 2019/11/10 21:16:34 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zkbd.c,v 1.20 2020/11/21 17:22:03 thorpej Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #if 0  /* XXX */
@@ -29,7 +29,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/malloc.h>
+#include <sys/kmem.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
 #include <sys/signalvar.h>
@@ -283,10 +283,10 @@
                aprint_error_dev(sc->sc_dev,
                    "couldn't establish power handler\n");
 
-       sc->sc_okeystate = malloc(sc->sc_nsense * sc->sc_nstrobe,
-           M_DEVBUF, M_WAITOK | M_ZERO);
-       sc->sc_keystate = malloc(sc->sc_nsense * sc->sc_nstrobe,
-           M_DEVBUF, M_WAITOK | M_ZERO);
+       sc->sc_okeystate = kmem_zalloc(sc->sc_nsense * sc->sc_nstrobe,
+           KM_SLEEP);
+       sc->sc_keystate = kmem_zalloc(sc->sc_nsense * sc->sc_nstrobe,
+           KM_SLEEP);
 
        /* set all the strobe bits */
        for (i = 0; i < sc->sc_nstrobe; i++) {



Home | Main Index | Thread Index | Old Index