Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari Allow storage-space to be passed to the alloc...



details:   https://anonhg.NetBSD.org/src/rev/45471ff4864a
branches:  trunk
changeset: 480763:45471ff4864a
user:      leo <leo%NetBSD.org@localhost>
date:      Wed Jan 19 13:12:54 2000 +0000

description:
Allow storage-space to be passed to the alloc_bus_space_tag() functions. This
permits static tags to be used during early console init.

diffstat:

 sys/arch/atari/atari/be_bus.c    |  17 ++++++++++++-----
 sys/arch/atari/atari/le_bus.c    |  19 +++++++++++++------
 sys/arch/atari/include/bus.h     |   8 +++++++-
 sys/arch/atari/isa/isa_machdep.c |   7 +++----
 sys/arch/atari/pci/pci_machdep.c |   8 +++-----
 sys/arch/atari/vme/vme_machdep.c |   7 +++----
 6 files changed, 41 insertions(+), 25 deletions(-)

diffs (183 lines):

diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/atari/be_bus.c
--- a/sys/arch/atari/atari/be_bus.c     Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/atari/be_bus.c     Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: be_bus.c,v 1.3 1998/05/25 09:08:08 leo Exp $   */
+/*     $NetBSD: be_bus.c,v 1.4 2000/01/19 13:12:54 leo Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -161,8 +161,6 @@
                                bus_space_handle_t, bus_size_t, u_int64_t,
                                bus_size_t));
 
-bus_space_tag_t                beb_alloc_bus_space_tag __P((void));
-
 /*
  * Don't force a function call overhead on these primitives...
  */
@@ -177,12 +175,21 @@
 #define __write_8(h, o, v)     *((u_int64_t *)((h) + (o))) = (v)
 
 bus_space_tag_t
-beb_alloc_bus_space_tag()
+beb_alloc_bus_space_tag(storage)
+bus_space_tag_t        storage;
 {
        bus_space_tag_t beb_t;
 
-       if ((beb_t = malloc(sizeof(*beb_t), M_TEMP, M_NOWAIT)) == NULL)
+       /*
+        * Allow the caller to specify storage space for the tag. This
+        * is used during console config (when malloc() can't be used).
+        */
+       if (storage != NULL)
+               beb_t = storage;
+       else {
+           if ((beb_t = malloc(sizeof(*beb_t), M_TEMP, M_NOWAIT)) == NULL)
                return(NULL);
+       }
        bzero(beb_t, sizeof(*beb_t));
        
        beb_t->abs_p_1   = beb_bus_space_peek_1;
diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/atari/le_bus.c
--- a/sys/arch/atari/atari/le_bus.c     Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/atari/le_bus.c     Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: le_bus.c,v 1.4 1999/02/19 20:57:03 leo Exp $   */
+/*     $NetBSD: le_bus.c,v 1.5 2000/01/19 13:12:55 leo Exp $   */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -222,8 +222,6 @@
                                bus_space_handle_t, bus_size_t, u_int64_t,
                                bus_size_t));
 
-bus_space_tag_t                leb_alloc_bus_space_tag __P((void));
-
 /*
  * Define these inline, to avoid function call overhead.
  * XXX: Maybe move to an m68k include file?
@@ -259,12 +257,21 @@
 #define __write_8(h, o, v)     *((u_int64_t *)((h) + (o))) = bswap64(v)
 
 bus_space_tag_t
-leb_alloc_bus_space_tag()
+leb_alloc_bus_space_tag(storage)
+bus_space_tag_t        storage;
 {
-       bus_space_tag_t leb_t;
+       bus_space_tag_t                 leb_t;
 
-       if ((leb_t = malloc(sizeof(*leb_t), M_TEMP, M_NOWAIT)) == NULL)
+       /*
+        * Allow the caller to specify storage space for the tag. This
+        * is used during console config (when malloc() can't be used).
+        */
+       if (storage != NULL)
+               leb_t = storage;
+       else {
+           if ((leb_t = malloc(sizeof(*leb_t), M_TEMP, M_NOWAIT)) == NULL)
                return(NULL);
+       }
        bzero(leb_t, sizeof(*leb_t));
        
        leb_t->abs_p_1   = leb_bus_space_peek_1;
diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/include/bus.h
--- a/sys/arch/atari/include/bus.h      Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/include/bus.h      Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus.h,v 1.19 1999/12/13 15:40:28 leo Exp $     */
+/*     $NetBSD: bus.h,v 1.20 2000/01/19 13:13:07 leo Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -101,6 +101,12 @@
                                bus_size_t, bus_size_t, bus_space_handle_t *));
 
 /*
+ * Tag allocation
+ */
+bus_space_tag_t                beb_alloc_bus_space_tag __P((bus_space_tag_t));
+bus_space_tag_t                leb_alloc_bus_space_tag __P((bus_space_tag_t));
+
+/*
  * XXX
  */
 bus_space_tag_t        mb_alloc_bus_space_tag __P((void));
diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/isa/isa_machdep.c
--- a/sys/arch/atari/isa/isa_machdep.c  Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/isa/isa_machdep.c  Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isa_machdep.c,v 1.15 1999/11/23 14:48:58 leo Exp $     */
+/*     $NetBSD: isa_machdep.c,v 1.16 2000/01/19 13:13:14 leo Exp $     */
 
 /*
  * Copyright (c) 1997 Leo Weppelman.  All rights reserved.
@@ -85,12 +85,11 @@
 {
        struct isabus_softc *sc = (struct isabus_softc *)dp;
        struct isabus_attach_args       iba;
-       bus_space_tag_t                 leb_alloc_bus_space_tag __P((void));
 
        iba.iba_busname = "isa";
        iba.iba_dmat    = BUS_ISA_DMA_TAG;
-       iba.iba_iot     = leb_alloc_bus_space_tag();
-       iba.iba_memt    = leb_alloc_bus_space_tag();
+       iba.iba_iot     = leb_alloc_bus_space_tag(NULL);
+       iba.iba_memt    = leb_alloc_bus_space_tag(NULL);
        iba.iba_ic      = &sc->sc_chipset;
        if ((iba.iba_iot == NULL) || (iba.iba_memt == NULL)) {
                printf("leb_alloc_bus_space_tag failed!\n");
diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/pci/pci_machdep.c
--- a/sys/arch/atari/pci/pci_machdep.c  Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/pci/pci_machdep.c  Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.20 1999/11/07 22:23:05 thomas Exp $  */
+/*     $NetBSD: pci_machdep.c,v 1.21 2000/01/19 13:13:16 leo Exp $     */
 
 /*
  * Copyright (c) 1996 Leo Weppelman.  All rights reserved.
@@ -126,8 +126,6 @@
 void           *auxp;
 {
        struct pcibus_attach_args       pba;
-       bus_space_tag_t                 leb_alloc_bus_space_tag __P((void));
-
 
        enable_pci_devices();
 
@@ -136,8 +134,8 @@
        pba.pba_bus     = 0;
        pba.pba_flags   = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
        pba.pba_dmat    = BUS_PCI_DMA_TAG;
-       pba.pba_iot     = leb_alloc_bus_space_tag();
-       pba.pba_memt    = leb_alloc_bus_space_tag();
+       pba.pba_iot     = leb_alloc_bus_space_tag(NULL);
+       pba.pba_memt    = leb_alloc_bus_space_tag(NULL);
        if ((pba.pba_iot == NULL) || (pba.pba_memt == NULL)) {
                printf("leb_alloc_bus_space_tag failed!\n");
                return;
diff -r bdcaaa92c2b0 -r 45471ff4864a sys/arch/atari/vme/vme_machdep.c
--- a/sys/arch/atari/vme/vme_machdep.c  Wed Jan 19 12:30:12 2000 +0000
+++ b/sys/arch/atari/vme/vme_machdep.c  Wed Jan 19 13:12:54 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vme_machdep.c,v 1.6 1998/09/15 10:45:11 leo Exp $      */
+/*     $NetBSD: vme_machdep.c,v 1.7 2000/01/19 13:13:18 leo Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -78,11 +78,10 @@
 void           *auxp;
 {
        struct vmebus_attach_args       vba;
-       bus_space_tag_t                 beb_alloc_bus_space_tag __P((void));
 
        vba.vba_busname = "vme";
-       vba.vba_iot     = beb_alloc_bus_space_tag();
-       vba.vba_memt    = beb_alloc_bus_space_tag();
+       vba.vba_iot     = beb_alloc_bus_space_tag(NULL);
+       vba.vba_memt    = beb_alloc_bus_space_tag(NULL);
        if ((vba.vba_iot == NULL) || (vba.vba_memt == NULL)) {
                printf("beb_alloc_bus_space_tag failed!\n");
                return;



Home | Main Index | Thread Index | Old Index