PERFORCE change 94171 for review
John Baldwin
jhb at FreeBSD.org
Tue Mar 28 15:21:46 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=94171
Change 94171 by jhb at jhb_slimer on 2006/03/28 15:21:11
Add an internal (locked) version of linker_file_lookup_symbol().
Affected files ...
.. //depot/projects/smpng/sys/kern/kern_linker.c#48 edit
.. //depot/projects/smpng/sys/sys/linker.h#18 edit
Differences ...
==== //depot/projects/smpng/sys/kern/kern_linker.c#48 (text+ko) ====
@@ -635,13 +635,25 @@
caddr_t
linker_file_lookup_symbol(linker_file_t file, const char *name, int deps)
{
+ caddr_t sym;
+
+ KLD_LOCK();
+ sym = linker_file_lookup_symbol_internal(file, name, deps);
+ KLD_UNLOCK();
+ return (sym);
+}
+
+caddr_t
+linker_file_lookup_symbol_internal(linker_file_t file, const char *name,
+ int deps)
+{
c_linker_sym_t sym;
linker_symval_t symval;
caddr_t address;
size_t common_size = 0;
int i;
- KLD_LOCK();
+ KLD_LOCK_ASSERT();
KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%p, name=%s, deps=%d\n",
file, name, deps));
@@ -657,7 +669,6 @@
else {
KLD_DPF(SYM, ("linker_file_lookup_symbol: symbol"
".value=%p\n", symval.value));
- KLD_UNLOCK();
return (symval.value);
}
}
@@ -668,7 +679,6 @@
if (address) {
KLD_DPF(SYM, ("linker_file_lookup_symbol:"
" deps value=%p\n", address));
- KLD_UNLOCK();
return (address);
}
}
@@ -685,7 +695,6 @@
if (strcmp(cp->name, name) == 0) {
KLD_DPF(SYM, ("linker_file_lookup_symbol:"
" old common value=%p\n", cp->address));
- KLD_UNLOCK();
return (cp->address);
}
}
@@ -704,10 +713,8 @@
KLD_DPF(SYM, ("linker_file_lookup_symbol: new common"
" value=%p\n", cp->address));
- KLD_UNLOCK();
return (cp->address);
}
- KLD_UNLOCK();
KLD_DPF(SYM, ("linker_file_lookup_symbol: fail\n"));
return (0);
}
==== //depot/projects/smpng/sys/sys/linker.h#18 (text+ko) ====
@@ -146,6 +146,8 @@
* Functions soley for use by the linker class handlers.
*/
int linker_add_class(linker_class_t _cls);
+caddr_t linker_file_lookup_symbol_internal(linker_file_t _file,
+ const char* _name, int _deps);
int linker_file_unload_internal(linker_file_t _file, int flags);
int linker_load_dependencies(linker_file_t _lf);
linker_file_t linker_make_file(const char* _filename, linker_class_t _cls);
More information about the p4-projects
mailing list