PERFORCE change 94933 for review
John Baldwin
jhb at FreeBSD.org
Mon Apr 10 18:40:56 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94933
Change 94933 by jhb at jhb_slimer on 2006/04/10 18:40:04
Always use the kernel linker instead of depending on ld(8).
Affected files ...
.. //depot/projects/smpng/sys/modules/crash2/crash2.c#6 edit
Differences ...
==== //depot/projects/smpng/sys/modules/crash2/crash2.c#6 (text+ko) ====
@@ -61,10 +61,6 @@
#define NTHREADS 4
-#ifndef __amd64__
-#define USE_SET
-#endif
-
typedef void (*event_handler)(void);
struct crash2_event {
@@ -72,10 +68,6 @@
event_handler ev_handler[NTHREADS];
};
-#ifdef USE_SET
-SET_DECLARE(crash2_event_set, struct crash2_event);
-#endif
-
#define CRASH2_EVENT(name, func, ...) \
_CRASH2_EVENT(name, __LINE__, func , ## __VA_ARGS__)
#define _CRASH2_EVENT(name, line, func, ...) \
@@ -85,16 +77,10 @@
{ name, { func , ## __VA_ARGS__ } }; \
DATA_SET(crash2_event_set, crash2_event_ ## line)
-#ifdef USE_SET
-#define MAX_EVENT SET_COUNT(crash2_event_set)
-#else
#define MAX_EVENT event_max
-#endif
-#ifndef USE_SET
static int event_max;
static struct crash2_event **event_start, **event_stop;
-#endif
static struct cv event_cv;
static struct mtx event_mtx;
static struct proc *kthread[NTHREADS];
@@ -179,20 +165,11 @@
{
struct crash2_event **ev;
-#ifdef USE_SET
- SET_FOREACH(ev, crash2_event_set) {
-#else
for (ev = event_start; ev < event_stop; ev++) {
-#endif
/* Skip null event 0. */
if ((*ev)->ev_name == NULL)
continue;
-#ifdef USE_SET
- printf("%4td %s\n", ev - SET_BEGIN(crash2_event_set),
-#else
- printf("%4td %s\n", ev - event_start,
-#endif
- (*ev)->ev_name);
+ printf("%4td %s\n", ev - event_start, (*ev)->ev_name);
}
}
CRASH2_EVENT("help", help);
@@ -263,11 +240,7 @@
printf("crash2[%d]: event %d is not defined!\n", i, ev);
continue;
}
-#ifdef USE_SET
- evp = SET_ITEM(crash2_event_set, ev);
-#else
evp = event_start[ev];
-#endif
if (evp->ev_handler[i])
evp->ev_handler[i]();
mtx_lock(&event_mtx);
@@ -344,12 +317,10 @@
switch (cmd) {
case MOD_LOAD:
-#ifndef USE_SET
error = linker_file_lookup_set(module_file(module),
"crash2_event_set", &event_start, &event_stop, &event_max);
if (error)
break;
-#endif
error = load(arg);
break;
case MOD_UNLOAD:
More information about the p4-projects
mailing list