Rev 332 | Rev 344 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 332 | Rev 341 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (C) 2005 Ondrej Palkovsky |
2 | * Copyright (C) 2005 Ondrej Palkovsky |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
7 | * are met: |
8 | * |
8 | * |
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * - Redistributions in binary form must reproduce the above copyright |
11 | * - Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
13 | * documentation and/or other materials provided with the distribution. |
14 | * - The name of the author may not be used to endorse or promote products |
14 | * - The name of the author may not be used to endorse or promote products |
15 | * derived from this software without specific prior written permission. |
15 | * derived from this software without specific prior written permission. |
16 | * |
16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
27 | */ |
28 | 28 | ||
29 | #ifndef __mips_ARC_H_ |
29 | #ifndef __mips32_ARC_H_ |
30 | #define __mips_ARC_H_ |
30 | #define __mips32_ARC_H_ |
31 | 31 | ||
32 | #include <arch/types.h> |
32 | #include <arch/types.h> |
33 | 33 | ||
34 | #define ARC_BASE_ADDR 0x1000; |
34 | #define ARC_BASE_ADDR 0x1000; |
35 | #define ARC_MAGIC 0x53435241 |
35 | #define ARC_MAGIC 0x53435241 |
36 | 36 | ||
37 | typedef struct { |
37 | typedef struct { |
38 | } arc_component; |
38 | } arc_component; |
39 | 39 | ||
40 | typedef struct { |
40 | typedef struct { |
41 | __u16 year; |
41 | __u16 year; |
42 | __u16 month; |
42 | __u16 month; |
43 | __u16 day; |
43 | __u16 day; |
44 | __u16 hour; |
44 | __u16 hour; |
45 | __u16 minutes; |
45 | __u16 minutes; |
46 | __u16 seconds; |
46 | __u16 seconds; |
47 | __u16 mseconds; |
47 | __u16 mseconds; |
48 | } arc_timeinfo ; |
48 | } arc_timeinfo ; |
49 | 49 | ||
50 | /* This is the SGI block structure, WinNT has it different */ |
50 | /* This is the SGI block structure, WinNT has it different */ |
51 | typedef enum { |
51 | typedef enum { |
52 | ExceptionBlock, |
52 | ExceptionBlock, |
53 | SystemParameterBlock, |
53 | SystemParameterBlock, |
54 | FreeContiguous, |
54 | FreeContiguous, |
55 | FreeMemory, |
55 | FreeMemory, |
56 | BadMemory, |
56 | BadMemory, |
57 | LoadedProgram, |
57 | LoadedProgram, |
58 | FirmwareTemporary, |
58 | FirmwareTemporary, |
59 | FirmwarePermanent |
59 | FirmwarePermanent |
60 | }arc_memorytype_t; |
60 | }arc_memorytype_t; |
61 | 61 | ||
62 | typedef struct { |
62 | typedef struct { |
63 | arc_memorytype_t type; |
63 | arc_memorytype_t type; |
64 | __u32 basepage; /* *4096 = baseaddr */ |
64 | __u32 basepage; /* *4096 = baseaddr */ |
65 | __u32 basecount; |
65 | __u32 basecount; |
66 | }arc_memdescriptor_t; |
66 | }arc_memdescriptor_t; |
67 | 67 | ||
68 | typedef struct { |
68 | typedef struct { |
69 | char vendorid[8]; |
69 | char vendorid[8]; |
70 | char prodid[8]; |
70 | char prodid[8]; |
71 | }arc_sysid_t; |
71 | }arc_sysid_t; |
72 | 72 | ||
73 | typedef struct { |
73 | typedef struct { |
74 | long (*load)(void); /* ... */ |
74 | long (*load)(void); /* ... */ |
75 | long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv, |
75 | long (*invoke)(__u32 eaddr,__u32 saddr,__u32 argc,char **argv, |
76 | char **envp); |
76 | char **envp); |
77 | long (*execute)(char *path,__u32 argc,char **argv,char **envp); |
77 | long (*execute)(char *path,__u32 argc,char **argv,char **envp); |
78 | void (*halt)(void); |
78 | void (*halt)(void); |
79 | void (*powerdown)(void); |
79 | void (*powerdown)(void); |
80 | void (*restart)(void); |
80 | void (*restart)(void); |
81 | void (*reboot)(void); |
81 | void (*reboot)(void); |
82 | void (*enterinteractivemode)(void); |
82 | void (*enterinteractivemode)(void); |
83 | long (*reserved)(void); |
83 | long (*reserved)(void); |
84 | /* 10 */ |
84 | /* 10 */ |
85 | arc_component * (*getpeer)(arc_component *c); |
85 | arc_component * (*getpeer)(arc_component *c); |
86 | arc_component * (*getchild)(arc_component *c); |
86 | arc_component * (*getchild)(arc_component *c); |
87 | arc_component * (*getparent)(arc_component *c); |
87 | arc_component * (*getparent)(arc_component *c); |
88 | long (*getconfigurationdata)(void *configdata, arc_component *c); |
88 | long (*getconfigurationdata)(void *configdata, arc_component *c); |
89 | long (*addchild)(arc_component *c, arc_component *template, |
89 | long (*addchild)(arc_component *c, arc_component *template, |
90 | void *configdata); |
90 | void *configdata); |
91 | long (*deletecomponet)(arc_component *current); |
91 | long (*deletecomponet)(arc_component *current); |
92 | long (*getcomponent)(char *path); |
92 | long (*getcomponent)(char *path); |
93 | long (*saveconfiguration)(void); |
93 | long (*saveconfiguration)(void); |
94 | arc_sysid_t (*getsystemid)(void); |
94 | arc_sysid_t (*getsystemid)(void); |
95 | arc_memdescriptor_t * (*getmemorydescriptor)(arc_memdescriptor_t *cur); |
95 | arc_memdescriptor_t * (*getmemorydescriptor)(arc_memdescriptor_t *cur); |
96 | /* 20 */ |
96 | /* 20 */ |
97 | long (*reserved2)(void); |
97 | long (*reserved2)(void); |
98 | arc_timeinfo * (*gettime)(void); |
98 | arc_timeinfo * (*gettime)(void); |
99 | __u32 (*getrelativetime)(void); |
99 | __u32 (*getrelativetime)(void); |
100 | long (*getdirectoryentry)(); |
100 | long (*getdirectoryentry)(); |
101 | long (*open)(void); /* ... */ |
101 | long (*open)(void); /* ... */ |
102 | long (*close)(__u32 fileid); |
102 | long (*close)(__u32 fileid); |
103 | long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt); |
103 | long (*read)(__u32 fileid,void *buf,__u32 n,__u32 *cnt); |
104 | long (*getreadstatus)(); |
104 | long (*getreadstatus)(); |
105 | long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt); |
105 | long (*write)(__u32 fileid, void *buf,__u32 n,__u32 *cnt); |
106 | long (*seek)(void); /* ... */ |
106 | long (*seek)(void); /* ... */ |
107 | /* 30 */ |
107 | /* 30 */ |
108 | long (*mount)(void); /* ... */ |
108 | long (*mount)(void); /* ... */ |
109 | char * (*getenvironmentvariable)(char *name); |
109 | char * (*getenvironmentvariable)(char *name); |
110 | char * (*setenvironmentvariable)(char *name, char *value); |
110 | char * (*setenvironmentvariable)(char *name, char *value); |
111 | long (*getfileinformation)(void); /* ... */ |
111 | long (*getfileinformation)(void); /* ... */ |
112 | long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask); |
112 | long (*setfileinformation)(__u32 fileid,__u32 attflags,__u32 attmask); |
113 | void (*flushallcaches)(void); |
113 | void (*flushallcaches)(void); |
114 | long (*testunicodecharacter)(void); /* ... */ |
114 | long (*testunicodecharacter)(void); /* ... */ |
115 | long (*getdisplaystatus)(void); /* ... */ |
115 | long (*getdisplaystatus)(void); /* ... */ |
116 | } arc_func_vector_t; |
116 | } arc_func_vector_t; |
117 | 117 | ||
118 | typedef struct { |
118 | typedef struct { |
119 | __u32 signature; |
119 | __u32 signature; |
120 | __u32 length; |
120 | __u32 length; |
121 | __u16 version; |
121 | __u16 version; |
122 | __u16 revision; |
122 | __u16 revision; |
123 | void *restartblock; |
123 | void *restartblock; |
124 | void *debugblock; |
124 | void *debugblock; |
125 | void *gevector; |
125 | void *gevector; |
126 | void *utlbmissvector; |
126 | void *utlbmissvector; |
127 | __u32 firmwarevectorlen; |
127 | __u32 firmwarevectorlen; |
128 | arc_func_vector_t *firmwarevector; |
128 | arc_func_vector_t *firmwarevector; |
129 | __u32 privvectorlen; |
129 | __u32 privvectorlen; |
130 | void *privvector; |
130 | void *privvector; |
131 | __u32 adaptercount; |
131 | __u32 adaptercount; |
132 | }__attribute__ ((packed)) arc_sbp; |
132 | }__attribute__ ((packed)) arc_sbp; |
133 | 133 | ||
134 | extern int init_arc(void); |
134 | extern int init_arc(void); |
135 | extern void arc_print_memory_map(void); |
135 | extern void arc_print_memory_map(void); |
136 | extern int arc_enabled(void); |
136 | extern int arc_enabled(void); |
137 | extern void arc_putchar(char ch); |
137 | extern void arc_putchar(char ch); |
138 | 138 | ||
139 | #endif |
139 | #endif |
140 | 140 |