[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: booting l4-Hurd, memory unaligned
From: |
Derek Davies |
Subject: |
Re: booting l4-Hurd, memory unaligned |
Date: |
06 Apr 2005 23:18:19 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Sorry, let me try that again, this time with a compilable patch:
Index: ia32-cmain.c
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/laden/ia32-cmain.c,v
retrieving revision 1.14
diff -u -r1.14 ia32-cmain.c
--- ia32-cmain.c 17 Nov 2004 16:21:39 -0000 1.14
+++ ia32-cmain.c 7 Apr 2005 02:45:53 -0000
@@ -250,10 +250,20 @@
if (end >> 32)
panic ("L4 does not support more than 4 GB on ia32");
- if (mmap->base_addr & ((1 << 10) - 1)
- || mmap->length & ((1 << 10) - 1))
- panic ("Memory region (0x%llx - 0x%llx) is unaligned",
- mmap->base_addr, end);
+ if (mmap->type == 2)
+ {
+ int end = (mmap->base_addr + mmap->length) - 1;
+ int aligned_base = mmap->base_addr & (~((1 << 10) - 1));
+ int aligned_end = (end + ((1 << 10) - 1)) & (~((1 << 10) - 1));
+ int aligned_len = (aligned_end - aligned_base) + 1;
+ mmap->base_addr = aligned_base;
+ mmap->length = aligned_length;
+ }
+ else
+ if (mmap->base_addr & ((1 << 10) - 1)
+ || mmap->length & ((1 << 10) - 1))
+ panic ("Memory region (0x%llx - 0x%llx) is unaligned",
+ mmap->base_addr, end);
add_memory_map ((uint32_t) mmap->base_addr, (uint32_t) end,
mmap->type == 1
Index: ia32-cmain.c
===================================================================
RCS file: /cvsroot/hurd/hurd-l4/laden/ia32-cmain.c,v
retrieving revision 1.14
diff -u -r1.14 ia32-cmain.c
--- ia32-cmain.c 17 Nov 2004 16:21:39 -0000 1.14
+++ ia32-cmain.c 7 Apr 2005 03:09:22 -0000
@@ -250,10 +250,20 @@
if (end >> 32)
panic ("L4 does not support more than 4 GB on ia32");
- if (mmap->base_addr & ((1 << 10) - 1)
- || mmap->length & ((1 << 10) - 1))
- panic ("Memory region (0x%llx - 0x%llx) is unaligned",
- mmap->base_addr, end);
+ if (mmap->type == 2)
+ {
+ int end = (mmap->base_addr + mmap->length) - 1;
+ int aligned_base = mmap->base_addr & (~((1 << 10) - 1));
+ int aligned_end = (end + ((1 << 10) - 1)) & (~((1 << 10) - 1));
+ int aligned_length = (aligned_end - aligned_base) + 1;
+ mmap->base_addr = aligned_base;
+ mmap->length = aligned_length;
+ }
+ else
+ if (mmap->base_addr & ((1 << 10) - 1)
+ || mmap->length & ((1 << 10) - 1))
+ panic ("Memory region (0x%llx - 0x%llx) is unaligned",
+ mmap->base_addr, end);
add_memory_map ((uint32_t) mmap->base_addr, (uint32_t) end,
mmap->type == 1
- Re: booting l4-Hurd, memory unaligned, Andreas B. Mundt, 2005/04/02
- Re: booting l4-Hurd, memory unaligned, Derek Davies, 2005/04/04
- Re: booting l4-Hurd, memory unaligned, Yoshinori K. Okuji, 2005/04/05
- Re: booting l4-Hurd, memory unaligned, Marcus Brinkmann, 2005/04/06
- Re: booting l4-Hurd, memory unaligned, Derek Davies, 2005/04/06
- Re: booting l4-Hurd, memory unaligned,
Derek Davies <=
- Re: booting l4-Hurd, memory unaligned, Derek Davies, 2005/04/06
- Re: booting l4-Hurd, memory unaligned, Yoshinori K. Okuji, 2005/04/07
Re: booting l4-Hurd, memory unaligned, Derek Davies, 2005/04/17
Re: booting l4-Hurd, memory unaligned, Andreas B. Mundt, 2005/04/18