[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Module support for the PPC
From: |
Hollis Blanchard |
Subject: |
Re: Module support for the PPC |
Date: |
Mon, 20 Dec 2004 10:21:59 -0600 |
On Dec 19, 2004, at 3:17 PM, Marco Gerards wrote:
--- kern/dl.c 4 Apr 2004 13:46:01 -0000 1.7
+++ kern/dl.c 19 Dec 2004 21:15:02 -0000
@@ -479,6 +479,20 @@ grub_dl_unref (grub_dl_t mod)
return --mod->ref_count;
}
+static void
+grub_dl_flush_cache (grub_dl_t mod)
+{
+ grub_dl_segment_t seg;
+ grub_dl_segment_t segn;
+
+ for (seg = mod->segment; seg; seg = segn)
+ {
+ segn = seg->next;
+ grub_free (seg->addr);
+ grub_arch_dl_sync_caches (seg->addr, seg->size);
+ }
+}
+
That for loop confuses me. Couldn't it be written as
for (seg = mod->segment; seg; seg = seg->next)
?
Also, I'm not sure why grub_free is here. Is that intentional?
Unrelated, I don't like naming the function "grub_arch_dl_sync_caches",
since it has nothing to do dl code really; that's just the only user
right now. I'd prefer "grub_arch_sync_caches".
Other than that, looks fine to me, and I hope we can get this checked
in soon for some holiday hacking. :)
-Hollis