All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] (2.4.x bk) efi_memmap_walk_uc
@ 2003-07-22  0:43 Christopher Wedgwood
  2003-07-22  2:16 ` Bjorn Helgaas
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: Christopher Wedgwood @ 2003-07-22  0:43 UTC (permalink / raw)
  To: linux-ia64

Hi,

On SN2 we have a 'fetchop' driver which does various magical things
with uncached memory (atomic operations within or across partitions).

To support this we have efi_memmap_walk_uc defined in a very similar
way to efi_memmap_walk.

How do people feel about merging this in the generic code (rather than
hiding it away in the driver or something more complex like
abstraction and changes to the current efi code)?

I'd also like to see a version of this in 2.5.x.


 arch/ia64/kernel/efi.c |   27 +++++++++++++++++++++++++++
 include/linux/efi.h    |    1 +
 2 files changed, 28 insertions(+)



Flame away,

  --cw


=== arch/ia64/kernel/efi.c 1.12 vs edited ==--- 1.12/arch/ia64/kernel/efi.c	Fri Mar 14 16:08:01 2003
+++ edited/arch/ia64/kernel/efi.c	Mon Jul 21 17:34:27 2003
@@ -723,3 +723,30 @@
  	remove_proc_entry(efi_dir->name, NULL);
 #endif
 }
+
+/*
+ * Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that
+ * has memory that marked as only EFI_MEMORY_UC.
+ */
+void
+efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg)
+{
+	void *efi_map_start, *efi_map_end, *p;
+	efi_memory_desc_t *md;
+	u64 efi_desc_size, start, end;
+
+	efi_map_start = __va(ia64_boot_param->efi_memmap);
+	efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
+	efi_desc_size = ia64_boot_param->efi_memdesc_size;
+
+	for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
+		md = p;
+
+		if (md->attribute = EFI_MEMORY_UC) {
+			start = PAGE_ALIGN(md->phys_addr);
+			end = PAGE_ALIGN((md->phys_addr+(md->num_pages << EFI_PAGE_SHIFT)) & PAGE_MASK);
+			if ((*callback)(start, end, arg) < 0)
+				return;
+		}
+	}
+}
=== include/linux/efi.h 1.3 vs edited ==--- 1.3/include/linux/efi.h	Thu Sep 12 11:57:59 2002
+++ edited/include/linux/efi.h	Mon Jul 21 17:35:43 2003
@@ -260,6 +260,7 @@
 extern void efi_init (void);
 extern void efi_map_pal_code (void);
 extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
+extern void efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg);
 extern void efi_gettimeofday (struct timeval *tv);
 extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if possible */
 extern u64 efi_get_iobase (void);

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2003-07-30  9:21 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22  0:43 [PATCH] (2.4.x bk) efi_memmap_walk_uc Christopher Wedgwood
2003-07-22  2:16 ` Bjorn Helgaas
2003-07-22  2:58 ` Christopher Wedgwood
2003-07-22  3:08 ` Bjorn Helgaas
2003-07-22  4:43 ` Christopher Wedgwood
2003-07-25  1:15 ` David Mosberger
2003-07-29 18:34 ` Christopher Wedgwood
2003-07-29 18:45 ` Luck, Tony
2003-07-29 19:03 ` Christopher Wedgwood
2003-07-29 20:41 ` David Mosberger
2003-07-29 21:15 ` Christopher Wedgwood
2003-07-29 21:31 ` David Mosberger
2003-07-29 21:34 ` Luck, Tony
2003-07-29 22:05 ` Jack Steiner
2003-07-29 22:07 ` Christopher Wedgwood
2003-07-29 22:26 ` Luck, Tony
2003-07-29 22:30 ` David Mosberger
2003-07-29 22:35 ` Christopher Wedgwood
2003-07-29 22:37 ` Christopher Wedgwood
2003-07-29 22:47 ` Luck, Tony
2003-07-29 22:48 ` David Mosberger
2003-07-29 22:54 ` David Mosberger
2003-07-29 23:49 ` Jack Steiner
2003-07-29 23:54 ` Christopher Wedgwood
2003-07-29 23:56 ` Jack Steiner
2003-07-30  0:00 ` Christopher Wedgwood
2003-07-30  0:02 ` Christopher Wedgwood
2003-07-30  0:05 ` David Mosberger
2003-07-30  0:12 ` David Mosberger
2003-07-30  0:22 ` Jack Steiner
2003-07-30  9:21 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.