Browse Source

Move RELOCATE into config.h

Move ISA probe address logic from config.c into isa.c, create header file
config/isa.h.
tags/v0.9.3
Michael Brown 20 years ago
parent
commit
85b00c4b72
4 changed files with 33 additions and 57 deletions
  1. 0
    9
      src/Config
  2. 16
    38
      src/core/config.c
  3. 17
    3
      src/drivers/bus/isa.c
  4. 0
    7
      src/include/isa.h

+ 0
- 9
src/Config View File

304
 # CFLAGS+=	-DDHCP_USER_CLASS="5,'A','L','P','H','A',4,'B','E','T','A'" \
304
 # CFLAGS+=	-DDHCP_USER_CLASS="5,'A','L','P','H','A',4,'B','E','T','A'" \
305
 #		-DDHCP_USER_CLASS_LEN=11
305
 #		-DDHCP_USER_CLASS_LEN=11
306
 
306
 
307
-# for btext console support
308
-# CFLAGS+=	-DCONSOLE_BTEXT 
309
-# for direct PC kbd support 
310
-# CFLAGS+=	-DCONSOLE_PC_KBD
311
 # Set to enable FILO support
307
 # Set to enable FILO support
312
 # for FILO support it will make main call pci_init
308
 # for FILO support it will make main call pci_init
313
 # INCLUDE_FILO=y
309
 # INCLUDE_FILO=y
374
 # CFLAGS+=	-DBUILD_SERIAL
370
 # CFLAGS+=	-DBUILD_SERIAL
375
 # CFLAGS+=	-DBUILD_SERIAL -DBUILD_ID=\"testing\"
371
 # CFLAGS+=	-DBUILD_SERIAL -DBUILD_ID=\"testing\"
376
 
372
 
377
-# Do not relocate
378
-# core/relocate.c should really be moved to an arch specific directory
379
-# but this is here for archs that don't support relocation
380
-# CFLAGS+=	-DNORELOCATE
381
-
382
 
373
 
383
 
374
 
384
 
375
 

+ 16
- 38
src/core/config.c View File

8
 #include "etherboot.h"
8
 #include "etherboot.h"
9
 #include "dev.h"
9
 #include "dev.h"
10
 #include "console.h"
10
 #include "console.h"
11
+
12
+#include "config/general.h"
13
+
11
 #ifdef BUILD_SERIAL
14
 #ifdef BUILD_SERIAL
12
 #include ".buildserial.h"
15
 #include ".buildserial.h"
13
 #define xstr(s) str(s)
16
 #define xstr(s) str(s)
107
 /*
110
 /*
108
  * Drag in all requested console types
111
  * Drag in all requested console types
109
  *
112
  *
110
- * At least one of the CONSOLE_xxx has to be set.  CONSOLE_DUAL sets
113
+ * CONSOLE_DUAL sets both CONSOLE_FIRMWARE and CONSOLE_SERIAL for
111
- * both CONSOLE_FIRMWARE and CONSOLE_SERIAL for legacy compatibility.
114
+ * legacy compatibility.
112
- * If no CONSOLE_xxx is set, CONSOLE_FIRMWARE is assumed.
113
  *
115
  *
114
  */
116
  */
115
 
117
 
116
-#ifdef CONSOLE_CRT
118
+#if	CONSOLE_DUAL
117
-#define CONSOLE_FIRMWARE
119
+#undef	CONSOLE_FIRMWARE
118
-#endif
120
+#define	CONSOLE_FIRMWARE	1
119
-
121
+#undef	CONSOLE_SERIAL
120
-#ifdef	CONSOLE_DUAL
122
+#define	CONSOLE_SERIAL		1
121
-#undef CONSOLE_FIRMWARE
122
-#define CONSOLE_FIRMWARE
123
-#undef CONSOLE_SERIAL
124
-#define CONSOLE_SERIAL
125
 #endif
123
 #endif
126
 
124
 
127
-#if	!defined(CONSOLE_FIRMWARE) && !defined(CONSOLE_SERIAL)
125
+#if CONSOLE_FIRMWARE
128
-#define CONSOLE_FIRMWARE
129
-#endif
130
-
131
-#ifdef CONSOLE_FIRMWARE
132
 REQUIRE_OBJECT ( bios_console );
126
 REQUIRE_OBJECT ( bios_console );
133
 #endif
127
 #endif
134
 
128
 
135
-#ifdef CONSOLE_SERIAL
129
+#if CONSOLE_SERIAL
136
 REQUIRE_OBJECT ( serial );
130
 REQUIRE_OBJECT ( serial );
137
 #endif
131
 #endif
138
 
132
 
139
-#ifdef CONSOLE_DIRECT_VGA
133
+#if CONSOLE_DIRECT_VGA
140
 REQUIRE_OBJECT ( video_subr );
134
 REQUIRE_OBJECT ( video_subr );
141
 #endif
135
 #endif
142
 
136
 
143
-#ifdef CONSOLE_BTEXT
137
+#if CONSOLE_BTEXT
144
 REQUIRE_OBJECT ( btext );
138
 REQUIRE_OBJECT ( btext );
145
 #endif
139
 #endif
146
 
140
 
147
-#ifdef CONSOLE_PC_KBD
141
+#if CONSOLE_PC_KBD
148
 REQUIRE_OBJECT ( pc_kbd );
142
 REQUIRE_OBJECT ( pc_kbd );
149
 #endif
143
 #endif
150
 
144
 
153
  *
147
  *
154
  */
148
  */
155
 
149
 
156
-#ifndef NORELOCATE
150
+#if RELOCATE
157
 REQUIRE_OBJECT ( relocate );
151
 REQUIRE_OBJECT ( relocate );
158
 #endif
152
 #endif
159
-
160
-/*
161
- * Allow ISA probe address list to be overridden
162
- *
163
- */
164
-#include "isa.h"
165
-#ifndef ISA_PROBE_ADDRS
166
-#define ISA_PROBE_ADDRS
167
-#endif
168
-
169
-isa_probe_addr_t isa_extra_probe_addrs[] = {
170
-	ISA_PROBE_ADDRS
171
-};
172
-
173
-unsigned int isa_extra_probe_addr_count
174
-      = sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] );

+ 17
- 3
src/drivers/bus/isa.c View File

1
 #include "string.h"
1
 #include "string.h"
2
+#include "config/isa.h"
2
 #include "isa.h"
3
 #include "isa.h"
3
 
4
 
4
 /*
5
 /*
27
 DEV_BUS( struct isa_device, isa_dev );
28
 DEV_BUS( struct isa_device, isa_dev );
28
 static char isa_magic[0]; /* guaranteed unique symbol */
29
 static char isa_magic[0]; /* guaranteed unique symbol */
29
 
30
 
31
+/*
32
+ * User-supplied probe address list
33
+ *
34
+ */
35
+static isa_probe_addr_t isa_extra_probe_addrs[] = {
36
+	ISA_PROBE_ADDRS
37
+#if ISA_PROBE_ONLY
38
+	, 0
39
+#endif
40
+};
41
+#define isa_extra_probe_addr_count \
42
+     ( sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] ) )
43
+
30
 /*
44
 /*
31
  * Find an ISA device matching the specified driver
45
  * Find an ISA device matching the specified driver
32
  *
46
  *
41
 		isa->magic = isa_magic;
55
 		isa->magic = isa_magic;
42
 	}
56
 	}
43
 
57
 
44
-	/* Iterate through any ISA probe addresses specified by
58
+	/* Iterate through any ISA probe addresses specified by the
45
-	 * config.c, starting where we left off.
59
+	 * user, starting where we left off.
46
 	 */
60
 	 */
47
 	DBG ( "ISA searching for device matching driver %s\n", driver->name );
61
 	DBG ( "ISA searching for device matching driver %s\n", driver->name );
48
 	for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
62
 	for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
51
 			isa->already_tried = 0;
65
 			isa->already_tried = 0;
52
 			continue;
66
 			continue;
53
 		}
67
 		}
54
-
68
+		
55
 		/* Set I/O address */
69
 		/* Set I/O address */
56
 		ioaddr = isa_extra_probe_addrs[i];
70
 		ioaddr = isa_extra_probe_addrs[i];
57
 
71
 

+ 0
- 7
src/include/isa.h View File

66
 extern int find_isa_boot_device ( struct dev *dev,
66
 extern int find_isa_boot_device ( struct dev *dev,
67
 				  struct isa_driver *driver );
67
 				  struct isa_driver *driver );
68
 
68
 
69
-/*
70
- * config.c defines isa_extra_probe_addrs and isa_extra_probe_addr_count.
71
- *
72
- */
73
-extern isa_probe_addr_t isa_extra_probe_addrs[];
74
-extern unsigned int isa_extra_probe_addr_count;
75
-
76
 #endif /* ISA_H */
69
 #endif /* ISA_H */
77
 
70
 

Loading…
Cancel
Save