All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Wedgwood <cw@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] (2.4.x bk) efi_memmap_walk_uc
Date: Tue, 22 Jul 2003 00:43:54 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105883467032028@msgid-missing> (raw)

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);

             reply	other threads:[~2003-07-22  0:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-22  0:43 Christopher Wedgwood [this message]
2003-07-22  2:16 ` [PATCH] (2.4.x bk) efi_memmap_walk_uc 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105883467032028@msgid-missing \
    --to=cw@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.