~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/fw/arc/tree.c

Version: ~ [ linux-4.15-rc3 ] ~ [ linux-4.14.5 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.68 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.105 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.47 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.87 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.51 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.96 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.27.62 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * PROM component device tree code.
  7  *
  8  * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  9  * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
 10  * Copyright (C) 1999 Silicon Graphics, Inc.
 11  */
 12 #include <linux/init.h>
 13 #include <asm/fw/arc/types.h>
 14 #include <asm/sgialib.h>
 15 
 16 #undef DEBUG_PROM_TREE
 17 
 18 pcomponent * __init
 19 ArcGetPeer(pcomponent *Current)
 20 {
 21         if (Current == PROM_NULL_COMPONENT)
 22                 return PROM_NULL_COMPONENT;
 23 
 24         return (pcomponent *) ARC_CALL1(next_component, Current);
 25 }
 26 
 27 pcomponent * __init
 28 ArcGetChild(pcomponent *Current)
 29 {
 30         return (pcomponent *) ARC_CALL1(child_component, Current);
 31 }
 32 
 33 pcomponent * __init
 34 ArcGetParent(pcomponent *Current)
 35 {
 36         if (Current == PROM_NULL_COMPONENT)
 37                 return PROM_NULL_COMPONENT;
 38 
 39         return (pcomponent *) ARC_CALL1(parent_component, Current);
 40 }
 41 
 42 LONG __init
 43 ArcGetConfigurationData(VOID *Buffer, pcomponent *Current)
 44 {
 45         return ARC_CALL2(component_data, Buffer, Current);
 46 }
 47 
 48 pcomponent * __init
 49 ArcAddChild(pcomponent *Current, pcomponent *Template, VOID *ConfigurationData)
 50 {
 51         return (pcomponent *)
 52                ARC_CALL3(child_add, Current, Template, ConfigurationData);
 53 }
 54 
 55 LONG __init
 56 ArcDeleteComponent(pcomponent *ComponentToDelete)
 57 {
 58         return ARC_CALL1(comp_del, ComponentToDelete);
 59 }
 60 
 61 pcomponent * __init
 62 ArcGetComponent(CHAR *Path)
 63 {
 64         return (pcomponent *)ARC_CALL1(component_by_path, Path);
 65 }
 66 
 67 #ifdef DEBUG_PROM_TREE
 68 
 69 static char *classes[] = {
 70         "system", "processor", "cache", "adapter", "controller", "peripheral",
 71         "memory"
 72 };
 73 
 74 static char *types[] = {
 75         "arc", "cpu", "fpu", "picache", "pdcache", "sicache", "sdcache",
 76         "sccache", "memdev", "eisa adapter", "tc adapter", "scsi adapter",
 77         "dti adapter", "multi-func adapter", "disk controller",
 78         "tp controller", "cdrom controller", "worm controller",
 79         "serial controller", "net controller", "display controller",
 80         "parallel controller", "pointer controller", "keyboard controller",
 81         "audio controller", "misc controller", "disk peripheral",
 82         "floppy peripheral", "tp peripheral", "modem peripheral",
 83         "monitor peripheral", "printer peripheral", "pointer peripheral",
 84         "keyboard peripheral", "terminal peripheral", "line peripheral",
 85         "net peripheral", "misc peripheral", "anonymous"
 86 };
 87 
 88 static char *iflags[] = {
 89         "bogus", "read only", "removable", "console in", "console out",
 90         "input", "output"
 91 };
 92 
 93 static void __init
 94 dump_component(pcomponent *p)
 95 {
 96         printk("[%p]:class<%s>type<%s>flags<%s>ver<%d>rev<%d>",
 97                p, classes[p->class], types[p->type],
 98                iflags[p->iflags], p->vers, p->rev);
 99         printk("key<%08lx>\n\tamask<%08lx>cdsize<%d>ilen<%d>iname<%s>\n",
100                p->key, p->amask, (int)p->cdsize, (int)p->ilen, p->iname);
101 }
102 
103 static void __init
104 traverse(pcomponent *p, int op)
105 {
106         dump_component(p);
107         if(ArcGetChild(p))
108                 traverse(ArcGetChild(p), 1);
109         if(ArcGetPeer(p) && op)
110                 traverse(ArcGetPeer(p), 1);
111 }
112 
113 void __init
114 prom_testtree(void)
115 {
116         pcomponent *p;
117 
118         p = ArcGetChild(PROM_NULL_COMPONENT);
119         dump_component(p);
120         p = ArcGetChild(p);
121         while(p) {
122                 dump_component(p);
123                 p = ArcGetPeer(p);
124         }
125 }
126 
127 #endif /* DEBUG_PROM_TREE  */
128 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp