xserver: Branch 'master' - 7 commits
Adam Jackson
ajax at kemper.freedesktop.org
Wed Feb 4 19:41:13 PST 2009
hw/xfree86/loader/loader.c | 105 +++++++++++++++-----------------------------
hw/xfree86/loader/loadmod.c | 12 -----
2 files changed, 36 insertions(+), 81 deletions(-)
New commits:
commit bde028dd8d856f8d47c39e3c6d3731c34c398c74
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 22:58:58 2009 -0500
loader: Remove icache flushes on alpha.
If libdl doesn't already get this right for you, you have two problems.
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index 16105a7..dbf6c2e 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -1023,15 +1023,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist,
TestFree(name);
TestFree(p);
- /*
- * If you need to do something to keep the
- * instruction cache in sync with the main
- * memory before jumping to that code, you may
- * do it here.
- */
-#ifdef __alpha__
- istream_mem_barrier();
-#endif
return ret;
}
@@ -1108,9 +1099,6 @@ UnloadModuleOrDriver(ModuleDescPtr mod)
UnloadModuleOrDriver(mod->sib);
TestFree(mod->name);
xfree(mod);
-#ifdef __alpha__
- istream_mem_barrier();
-#endif
}
void
commit 910a1e88d23e0b7e4ca4679ab50a883a918f2590
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:54:07 2009 -0500
loader: Remove a vestige of archive support
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 5bd221f..ab77362 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -304,10 +304,7 @@ LoaderUnload(int handle)
*/
while ((tmp = _LoaderListPop(handle)) != NULL) {
- if (strchr(tmp->name, ':') == NULL) {
- /* It is not a member of an archive */
- xf86Msg(X_INFO, "Unloading %s\n", tmp->name);
- }
+ xf86Msg(X_INFO, "Unloading %s\n", tmp->name);
DLUnloadModule(tmp->private);
free(tmp->name);
free(tmp->cname);
commit 366f23c6eb504fc23112f121769bcb719948474f
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:53:05 2009 -0500
loader: Remove useless call to LoaderGetOS
We know what OS you're running on anyway, it's printed in the uname
string at the top of the log.
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 56016d2..5bd221f 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -117,8 +117,6 @@ _LoaderListPop(int handle)
void
LoaderInit(void)
{
- const char *osname = NULL;
-
char *ld_bind_now = getenv("LD_BIND_NOW");
if (ld_bind_now && *ld_bind_now) {
xf86Msg(X_ERROR, "LD_BIND_NOW is set, dlloader will NOT work!\n");
@@ -139,10 +137,6 @@ LoaderInit(void)
GET_ABI_MAJOR(LoaderVersionInfo.extensionVersion),
GET_ABI_MINOR(LoaderVersionInfo.extensionVersion));
- LoaderGetOS(&osname, NULL, NULL, NULL);
- if (osname)
- xf86MsgVerb(X_INFO, 2, "Loader running on %s\n", osname);
-
#if defined(__UNIXWARE__) && !defined(__GNUC__)
/* For UnixWare we need to load the C Runtime libraries which are
* normally auto-linked by the compiler. Otherwise we are bound to
commit 05e415a5a3f376e28955be3bf976390e8631e25f
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:52:07 2009 -0500
loader: Simplify loader magic
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index e12772e..56016d2 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -124,9 +124,7 @@ LoaderInit(void)
xf86Msg(X_ERROR, "LD_BIND_NOW is set, dlloader will NOT work!\n");
}
- xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *)
- ((long)xorg_symbols[0] ^ (long)xorg_symbols[1]
- ^ (long)xorg_symbols[2] ^ (long)xorg_symbols[3]));
+ xf86MsgVerb(X_INFO, 2, "Loader magic: %p\n", (void *)xorg_symbols);
xf86MsgVerb(X_INFO, 2, "Module ABI versions:\n");
xf86ErrorFVerb(2, "\t%s: %d.%d\n", ABI_CLASS_ANSIC,
GET_ABI_MAJOR(LoaderVersionInfo.ansicVersion),
commit bf1ca06a1693cbe5415a152936939ce3b088a022
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:51:35 2009 -0500
loader: Make a comment slightly less stupid
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index d74c1bb..e12772e 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -201,12 +201,7 @@ LoaderOpen(const char *module, const char *cname, int handle,
ErrorF("LoaderOpen(%s)\n", module);
#endif
- /*
- * Check to see if the module is already loaded.
- * Only if we are loading it into an existing namespace.
- * If it is to be loaded into a new namespace, don't check.
- * Note: We only have one namespace.
- */
+ /* Is the module already loaded? */
if (handle >= 0) {
tmp = listHead;
while (tmp) {
commit 499908aeca9a31692c787070e23bfaa92d1b32a4
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:50:00 2009 -0500
loader: code motion.
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 5632218..d74c1bb 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -83,8 +83,36 @@ static int refCount[MAX_HANDLE];
static int moduleseq = 0;
/* Prototypes for static functions. */
-static loaderPtr _LoaderListPush(void);
-static loaderPtr _LoaderListPop(int);
+static loaderPtr listHead = NULL;
+
+static loaderPtr
+_LoaderListPush(void)
+{
+ loaderPtr item = calloc(1, sizeof(struct _loader));
+
+ item->next = listHead;
+ listHead = item;
+
+ return item;
+}
+
+static loaderPtr
+_LoaderListPop(int handle)
+{
+ loaderPtr item = listHead;
+ loaderPtr *bptr = &listHead; /* pointer to previous node */
+
+ while (item) {
+ if (item->handle == handle) {
+ *bptr = item->next; /* remove this from the list */
+ return item;
+ }
+ bptr = &(item->next);
+ item = item->next;
+ }
+
+ return 0;
+}
void
LoaderInit(void)
@@ -139,37 +167,6 @@ LoaderInit(void)
#endif
}
-static loaderPtr listHead = (loaderPtr) 0;
-
-static loaderPtr
-_LoaderListPush(void)
-{
- loaderPtr item = calloc(1, sizeof(struct _loader));
-
- item->next = listHead;
- listHead = item;
-
- return item;
-}
-
-static loaderPtr
-_LoaderListPop(int handle)
-{
- loaderPtr item = listHead;
- loaderPtr *bptr = &listHead; /* pointer to previous node */
-
- while (item) {
- if (item->handle == handle) {
- *bptr = item->next; /* remove this from the list */
- return item;
- }
- bptr = &(item->next);
- item = item->next;
- }
-
- return 0;
-}
-
/* These four are just ABI stubs */
void
LoaderRefSymbols(const char *sym0, ...)
commit 28b6b1519c4c526662302fac4ed9b7f540bafd4a
Author: Adam Jackson <ajax at redhat.com>
Date: Mon Jan 26 07:47:46 2009 -0500
loader: Simplify handle allocation and refcounting.
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index dad44d8..5632218 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -77,20 +77,9 @@
extern void *xorg_symbols[];
-/*
- * handles are used to identify files that are loaded. Even archives
- * are counted as a single file.
- */
#define MAX_HANDLE 256
-#define HANDLE_FREE 0
-#define HANDLE_USED 1
-static char freeHandles[MAX_HANDLE];
static int refCount[MAX_HANDLE];
-/*
- * modules are used to identify compilation units (ie object modules).
- * Archives contain multiple modules, each of which is treated seperately.
- */
static int moduleseq = 0;
/* Prototypes for static functions. */
@@ -250,7 +239,7 @@ LoaderOpen(const char *module, const char *cname, int handle,
* Find a free handle.
*/
new_handle = 1;
- while (freeHandles[new_handle] && new_handle < MAX_HANDLE)
+ while (refCount[new_handle] && new_handle < MAX_HANDLE)
new_handle++;
if (new_handle == MAX_HANDLE) {
@@ -262,7 +251,6 @@ LoaderOpen(const char *module, const char *cname, int handle,
return -1;
}
- freeHandles[new_handle] = HANDLE_USED;
refCount[new_handle] = 1;
tmp = _LoaderListPush();
@@ -276,7 +264,7 @@ LoaderOpen(const char *module, const char *cname, int handle,
if ((tmp->private = DLLoadModule(tmp, flags)) == NULL) {
xf86Msg(X_ERROR, "Failed to load %s\n", module);
_LoaderListPop(new_handle);
- freeHandles[new_handle] = HANDLE_FREE;
+ refCount[new_handle] = 0;
if (errmaj)
*errmaj = LDR_NOLOAD;
if (errmin)
@@ -293,7 +281,7 @@ LoaderHandleOpen(int handle)
if (handle < 0 || handle >= MAX_HANDLE)
return -1;
- if (freeHandles[handle] != HANDLE_USED)
+ if (!refCount[handle])
return -1;
refCount[handle]++;
@@ -342,8 +330,6 @@ LoaderUnload(int handle)
free(tmp);
}
- freeHandles[handle] = HANDLE_FREE;
-
return 0;
}
More information about the xorg-commit
mailing list