소스 검색

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 19 년 전
부모
커밋
85b00c4b72
4개의 변경된 파일33개의 추가작업 그리고 57개의 파일을 삭제
  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 파일 보기

@@ -304,10 +304,6 @@ CFLAGS+=	-DASK_BOOT=3 -DBOOT_FIRST=BOOT_NIC
304 304
 # CFLAGS+=	-DDHCP_USER_CLASS="5,'A','L','P','H','A',4,'B','E','T','A'" \
305 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 307
 # Set to enable FILO support
312 308
 # for FILO support it will make main call pci_init
313 309
 # INCLUDE_FILO=y
@@ -374,11 +370,6 @@ CFLAGS+=	-DPXE_IMAGE -DPXE_EXPORT
374 370
 # CFLAGS+=	-DBUILD_SERIAL
375 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 파일 보기

@@ -8,6 +8,9 @@
8 8
 #include "etherboot.h"
9 9
 #include "dev.h"
10 10
 #include "console.h"
11
+
12
+#include "config/general.h"
13
+
11 14
 #ifdef BUILD_SERIAL
12 15
 #include ".buildserial.h"
13 16
 #define xstr(s) str(s)
@@ -107,44 +110,35 @@ void print_config ( void ) {
107 110
 /*
108 111
  * Drag in all requested console types
109 112
  *
110
- * At least one of the CONSOLE_xxx has to be set.  CONSOLE_DUAL sets
111
- * both CONSOLE_FIRMWARE and CONSOLE_SERIAL for legacy compatibility.
112
- * If no CONSOLE_xxx is set, CONSOLE_FIRMWARE is assumed.
113
+ * CONSOLE_DUAL sets both CONSOLE_FIRMWARE and CONSOLE_SERIAL for
114
+ * legacy compatibility.
113 115
  *
114 116
  */
115 117
 
116
-#ifdef CONSOLE_CRT
117
-#define CONSOLE_FIRMWARE
118
-#endif
119
-
120
-#ifdef	CONSOLE_DUAL
121
-#undef CONSOLE_FIRMWARE
122
-#define CONSOLE_FIRMWARE
123
-#undef CONSOLE_SERIAL
124
-#define CONSOLE_SERIAL
118
+#if	CONSOLE_DUAL
119
+#undef	CONSOLE_FIRMWARE
120
+#define	CONSOLE_FIRMWARE	1
121
+#undef	CONSOLE_SERIAL
122
+#define	CONSOLE_SERIAL		1
125 123
 #endif
126 124
 
127
-#if	!defined(CONSOLE_FIRMWARE) && !defined(CONSOLE_SERIAL)
128
-#define CONSOLE_FIRMWARE
129
-#endif
130
-
131
-#ifdef CONSOLE_FIRMWARE
125
+#if CONSOLE_FIRMWARE
132 126
 REQUIRE_OBJECT ( bios_console );
133 127
 #endif
134 128
 
135
-#ifdef CONSOLE_SERIAL
129
+#if CONSOLE_SERIAL
136 130
 REQUIRE_OBJECT ( serial );
137 131
 #endif
138 132
 
139
-#ifdef CONSOLE_DIRECT_VGA
133
+#if CONSOLE_DIRECT_VGA
140 134
 REQUIRE_OBJECT ( video_subr );
141 135
 #endif
142 136
 
143
-#ifdef CONSOLE_BTEXT
137
+#if CONSOLE_BTEXT
144 138
 REQUIRE_OBJECT ( btext );
145 139
 #endif
146 140
 
147
-#ifdef CONSOLE_PC_KBD
141
+#if CONSOLE_PC_KBD
148 142
 REQUIRE_OBJECT ( pc_kbd );
149 143
 #endif
150 144
 
@@ -153,22 +147,6 @@ REQUIRE_OBJECT ( pc_kbd );
153 147
  *
154 148
  */
155 149
 
156
-#ifndef NORELOCATE
150
+#if RELOCATE
157 151
 REQUIRE_OBJECT ( relocate );
158 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 파일 보기

@@ -1,4 +1,5 @@
1 1
 #include "string.h"
2
+#include "config/isa.h"
2 3
 #include "isa.h"
3 4
 
4 5
 /*
@@ -27,6 +28,19 @@
27 28
 DEV_BUS( struct isa_device, isa_dev );
28 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 45
  * Find an ISA device matching the specified driver
32 46
  *
@@ -41,8 +55,8 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
41 55
 		isa->magic = isa_magic;
42 56
 	}
43 57
 
44
-	/* Iterate through any ISA probe addresses specified by
45
-	 * config.c, starting where we left off.
58
+	/* Iterate through any ISA probe addresses specified by the
59
+	 * user, starting where we left off.
46 60
 	 */
47 61
 	DBG ( "ISA searching for device matching driver %s\n", driver->name );
48 62
 	for ( i = isa->probe_idx ; i < isa_extra_probe_addr_count ; i++ ) {
@@ -51,7 +65,7 @@ int find_isa_device ( struct isa_device *isa, struct isa_driver *driver ) {
51 65
 			isa->already_tried = 0;
52 66
 			continue;
53 67
 		}
54
-
68
+		
55 69
 		/* Set I/O address */
56 70
 		ioaddr = isa_extra_probe_addrs[i];
57 71
 

+ 0
- 7
src/include/isa.h 파일 보기

@@ -66,12 +66,5 @@ extern int find_isa_device ( struct isa_device *eisa,
66 66
 extern int find_isa_boot_device ( struct dev *dev,
67 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 69
 #endif /* ISA_H */
77 70
 

Loading…
취소
저장