Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sun68k/stand/libsa Make local functions static.



details:   https://anonhg.NetBSD.org/src/rev/81820b3d723b
branches:  trunk
changeset: 973063:81820b3d723b
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Thu Jun 18 17:59:05 2020 +0000

description:
Make local functions static.

Tested on 3/60.

diffstat:

 sys/arch/sun68k/stand/libsa/idprom.c |  18 ++++----
 sys/arch/sun68k/stand/libsa/sun2.c   |  74 +++++++++++++++++------------------
 sys/arch/sun68k/stand/libsa/sun3.c   |  66 ++++++++++++++++----------------
 sys/arch/sun68k/stand/libsa/sun3x.c  |  58 ++++++++++++++--------------
 4 files changed, 106 insertions(+), 110 deletions(-)

diffs (truncated from 585 to 300 lines):

diff -r 7eb7e1500f3f -r 81820b3d723b sys/arch/sun68k/stand/libsa/idprom.c
--- a/sys/arch/sun68k/stand/libsa/idprom.c      Thu Jun 18 16:56:31 2020 +0000
+++ b/sys/arch/sun68k/stand/libsa/idprom.c      Thu Jun 18 17:59:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: idprom.c,v 1.6 2009/01/12 07:00:59 tsutsui Exp $       */
+/*     $NetBSD: idprom.c,v 1.7 2020/06/18 17:59:05 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -49,12 +49,12 @@
 u_char cpu_machine_id = 0;
 struct idprom identity_prom = { 0 };
 
-int idprom_cksum(u_char *);
-void idprom_init2(void);
-void idprom_init3(void);
-void idprom_init3x(void);
+static int idprom_cksum(u_char *);
+static void idprom_init2(void);
+static void idprom_init3(void);
+static void idprom_init3x(void);
 
-int
+static int
 idprom_cksum(u_char *p)
 {
        int len, x;
@@ -100,7 +100,7 @@
  * Sun2 version:
  * Just copy it from control space.
  */
-void 
+static void 
 idprom_init2(void)
 {
 
@@ -114,7 +114,7 @@
  * Sun3 version:
  * Just copy it from control space.
  */
-void 
+static void 
 idprom_init3(void)
 {
 
@@ -135,7 +135,7 @@
  * to search was determined from some "insider" info. about
  * the layout of the PROM data area.
  */
-void 
+static void 
 idprom_init3x(void)
 {
        u_char *p;
diff -r 7eb7e1500f3f -r 81820b3d723b sys/arch/sun68k/stand/libsa/sun2.c
--- a/sys/arch/sun68k/stand/libsa/sun2.c        Thu Jun 18 16:56:31 2020 +0000
+++ b/sys/arch/sun68k/stand/libsa/sun2.c        Thu Jun 18 17:59:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun2.c,v 1.11 2009/12/11 18:42:05 tsutsui Exp $        */
+/*     $NetBSD: sun2.c,v 1.12 2020/06/18 17:59:05 tsutsui Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -33,12 +33,6 @@
  * Standalone functions specific to the Sun2.
  */
 
-/* Need to avoid conflicts on these: */
-#define get_pte sun2_get_pte
-#define set_pte sun2_set_pte
-#define get_segmap sun2_get_segmap
-#define set_segmap sun2_set_segmap
-
 /*
  * We need to get the sun2 NBSG definition, even if we're 
  * building this with a different sun68k target.
@@ -68,14 +62,16 @@
 
 #define OBIO_MASK 0xFFFFFF
 
-u_int  get_pte(vaddr_t);
-void   set_pte(vaddr_t, u_int);
-void   dvma2_init(void);
-char * dvma2_alloc(int);
-void   dvma2_free(char *, int);
-char * dvma2_mapin(char *, int);
-void   dvma2_mapout(char *, int);
-char * dev2_mapin(int, u_long, int);
+static u_int   sun2_get_pte(vaddr_t);
+static void    sun2_set_pte(vaddr_t, u_int);
+static void    dvma2_init(void);
+static char *  dvma2_alloc(int);
+static void    dvma2_free(char *, int);
+static char *  dvma2_mapin(char *, int);
+static void    dvma2_mapout(char *, int);
+static char *  dev2_mapin(int, u_long, int);
+static int     sun2_get_segmap(vaddr_t);
+static void    sun2_set_segmap(vaddr_t, int);
 
 struct mapinfo {
        int maptype;
@@ -108,7 +104,7 @@
 /* The virtual address we will use for PROM device mappings. */
 int sun2_devmap = SUN3_MONSHORTSEG;
 
-char *
+static char *
 dev2_mapin(int maptype, u_long physaddr, int length)
 {
 #ifdef notyet
@@ -132,7 +128,7 @@
 
        va = pgva = sun2_devmap;
        do {
-               set_pte(pgva, pte);
+               sun2_set_pte(pgva, pte);
                pgva += NBPG;
                pte += 1;
                length -= NBPG;
@@ -143,7 +139,7 @@
 #ifdef DEBUG_PROM
        if (debug)
                printf("dev2_mapin: va=0x%x pte=0x%x\n",
-                          va, get_pte(va));
+                          va, sun2_get_pte(va));
 #endif
        return ((char*)va);
 #else
@@ -175,7 +171,7 @@
 /* This points to the end of the free DVMA space. */
 u_int dvma2_end = DVMA_BASE + DVMA_MAPLEN;
 
-void 
+static void 
 dvma2_init(void)
 {
        int segva, dmava, sme;
@@ -184,15 +180,15 @@
        dmava = DVMA_BASE;
 
        while (segva < SA_MAX_VA) {
-               sme = get_segmap(segva);
-               set_segmap(dmava, sme);
+               sme = sun2_get_segmap(segva);
+               sun2_set_segmap(dmava, sme);
                segva += NBSG;
                dmava += NBSG;
        }
 }
 
 /* Convert a local address to a DVMA address. */
-char *
+static char *
 dvma2_mapin(char *addr, int len)
 {
        int va = (int)addr;
@@ -219,7 +215,7 @@
                panic("dvma2_mapout");
 }
 
-char *
+static char *
 dvma2_alloc(int len)
 {
        len = m68k_round_page(len);
@@ -237,8 +233,8 @@
  * Control space stuff...
  */
 
-u_int
-get_pte(vaddr_t va)
+static u_int
+sun2_get_pte(vaddr_t va)
 {
        u_int pte;
 
@@ -263,8 +259,8 @@
        return (pte);
 }
 
-void
-set_pte(vaddr_t va, u_int pte)
+static void
+sun2_set_pte(vaddr_t va, u_int pte)
 {
        if (pte & PG_VALID) {
                /* Clear bit 26 (the user writable bit).  */
@@ -291,15 +287,15 @@
        set_control_word(CONTROL_ADDR_BUILD(PGMAP_BASE, va), pte);
 }
 
-int
-get_segmap(vaddr_t va)
+static int
+sun2_get_segmap(vaddr_t va)
 {
        va = CONTROL_ADDR_BUILD(SEGMAP_BASE, va);
        return (get_control_byte(va));
 }
 
-void
-set_segmap(vaddr_t va, int sme)
+static void
+sun2_set_segmap(vaddr_t va, int sme)
 {
        va = CONTROL_ADDR_BUILD(SEGMAP_BASE, va);
        set_control_byte(va, sme);
@@ -386,13 +382,13 @@
 
        /* Map chunk zero for loading. */
        for(off = 0; off < MEM_CHUNK0_SIZE; off += NBSG)
-               set_segmap(MEM_CHUNK0_LOAD_VIRT + off,
-                          get_segmap(MEM_CHUNK0_LOAD_VIRT_PROM + off));
+               sun2_set_segmap(MEM_CHUNK0_LOAD_VIRT + off,
+                          sun2_get_segmap(MEM_CHUNK0_LOAD_VIRT_PROM + off));
 
        /* Map chunk one for loading. */
        for(off = 0; off < MEM_CHUNK1_SIZE; off += NBSG)
-               set_segmap(MEM_CHUNK1_LOAD_VIRT + off,
-                          get_segmap(MEM_CHUNK1_LOAD_VIRT_PROM + off));
+               sun2_set_segmap(MEM_CHUNK1_LOAD_VIRT + off,
+                          sun2_get_segmap(MEM_CHUNK1_LOAD_VIRT_PROM + off));
 
        /* Tell our caller where in virtual space to load. */
        return MEM_CHUNK0_LOAD_VIRT;
@@ -409,7 +405,7 @@
        /* Chunk zero is already mapped and copied. */
 
        /* Chunk one needs to be mapped and copied. */
-       pte = (get_pte(0) & ~PG_FRAME);
+       pte = (sun2_get_pte(0) & ~PG_FRAME);
        for(off = 0; off < MEM_CHUNK1_SIZE; ) {
 
                /*
@@ -423,12 +419,12 @@
                 * PMEG used to map the previous segment, which
                 * is now (since we already copied it) unused.
                 */
-               sme = get_segmap((MEM_CHUNK1_LOAD_VIRT_PROM + off) - NBSG);
-               set_segmap(MEM_CHUNK1_COPY_VIRT + off, sme);
+               sme = sun2_get_segmap((MEM_CHUNK1_LOAD_VIRT_PROM + off) - NBSG);
+               sun2_set_segmap(MEM_CHUNK1_COPY_VIRT + off, sme);
 
                /* Set the PTEs in this new PMEG. */
                for(off_end = off + NBSG; off < off_end; off += NBPG)
-                       set_pte(MEM_CHUNK1_COPY_VIRT + off, 
+                       sun2_set_pte(MEM_CHUNK1_COPY_VIRT + off, 
                                pte | PA_PGNUM(MEM_CHUNK1_COPY_PHYS + off));
                
                /* Copy this segment. */
diff -r 7eb7e1500f3f -r 81820b3d723b sys/arch/sun68k/stand/libsa/sun3.c
--- a/sys/arch/sun68k/stand/libsa/sun3.c        Thu Jun 18 16:56:31 2020 +0000
+++ b/sys/arch/sun68k/stand/libsa/sun3.c        Thu Jun 18 17:59:05 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun3.c,v 1.9 2009/12/11 18:42:05 tsutsui Exp $ */
+/*     $NetBSD: sun3.c,v 1.10 2020/06/18 17:59:05 tsutsui Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,12 +35,6 @@
 
 #define _SUN3_ XXX
 
-/* Need to avoid conflicts on these: */
-#define get_pte sun3_get_pte
-#define set_pte sun3_set_pte
-#define get_segmap sun3_get_segmap
-#define set_segmap sun3_set_segmap
-
 /* 
  * We need to get the sun3 NBSG definition, even if we're
  * building this with a different sun68k target.
@@ -63,14 +57,18 @@
 
 #define OBIO_MASK 0xFFFFFF
 
-u_int  get_pte(vaddr_t);
-void   set_pte(vaddr_t, u_int);
-void   dvma3_init(void);
-char * dvma3_alloc(int);
-void   dvma3_free(char *, int);
-char * dvma3_mapin(char *, int);
-void   dvma3_mapout(char *, int);
-char * dev3_mapin(int, u_long, int);
+#ifdef DEBUG_PROM
+static u_int   sun3_get_pte(vaddr_t);
+#endif
+static void    sun3_set_pte(vaddr_t, u_int);
+static void    dvma3_init(void);
+static char *  dvma3_alloc(int);
+static void    dvma3_free(char *, int);
+static char *  dvma3_mapin(char *, int);
+static void    dvma3_mapout(char *, int);
+static char *  dev3_mapin(int, u_long, int);
+static int     sun3_get_segmap(vaddr_t);
+static void    sun3_set_segmap(vaddr_t, int);
 
 struct mapinfo {
        int maptype;
@@ -101,7 +99,7 @@



Home | Main Index | Thread Index | Old Index