All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: pfn-Functionset out of order for sparc64 in current Bk tree?
@ 2002-05-07 19:12 Holzrichter, Bruce
  2002-05-07 19:27 ` Jan-Benedict Glaw
  0 siblings, 1 reply; 11+ messages in thread
From: Holzrichter, Bruce @ 2002-05-07 19:12 UTC (permalink / raw)
  To: 'Thunder from the hill', Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

>  - pfn_to_page(pfn) is declared as (mem_map + (pfn)) for 
> i386. Can this 
>    apply to Sparc64 as well?
>  - pte_pfn(x) is declared as
>    ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
>    in 2-level pgtable,
>    (((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT)))
>    in 3-level. I suppose 2-level shouldn't exactly match 
> here, how far 
>    must the 3-level version be changed in order to fit sparc64? A lot?
>  - pfn_valid(pfn) is described as ((pfn) < max_mapnr). 
> Suppose this is OK 
>    on Sparc64 either?
>  - pfn_pte(page,prot) is defined as
>    __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
>    How far does this go for Sparc64?
> 

I think about an hour or so ago, Tom Duffy posted some fixes to the
Sparclinux mailing list that may help you out.  I cc'd them here.  They may
help you out, I havn't looked at them yet, so YMMV.

Bruce H.

<snip>
On Sun, 2002-05-05 at 23:27, Keith Owens wrote:
> kbuild-2.5-common-2.5.14-1 and kbuild-2.5-i386-2.5.14-1 are available.
> Upgraded to kernel 2.5.14.

here is the sparc64 kbuild against core-11 and 2.5.14

you must apply the linux-2.5.14-sparc64-hacks.patch first to get sparc64
to build on 2.5.14 (even using kbuild 2.4)

0) untar linux-2.5.14.tar.bz2
1) apply linux-2.5.14-sparc64-hacks.patch
2) apply kbuild-2.5-core-11
3) apply kbuild-2.5-common-2.5.14-1
4) apply kbuild-2.5-sparc64-2.5.14-1

you should be good to go...

this patch still needs work on the asm-offsets to get it work The Right
Way (tm)

-tduffy
</snip>


[-- Attachment #2: linux-2.5.14-sparc64-hacks.patch --]
[-- Type: application/octet-stream, Size: 2923 bytes --]

--- linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1/include/asm-sparc64/page.h	Sun May  5 20:38:01 2002
+++ linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1+sparc64-1/include/asm-sparc64/page.h	Mon May  6 11:02:04 2002
@@ -113,8 +113,17 @@
 
 #define __pa(x)			((unsigned long)(x) - PAGE_OFFSET)
 #define __va(x)			((void *)((unsigned long) (x) + PAGE_OFFSET))
+
+#if 0
 #define virt_to_page(kaddr)	(mem_map + ((__pa(kaddr)-phys_base) >> PAGE_SHIFT))
 #define VALID_PAGE(page)	((page - mem_map) < max_mapnr)
+#endif
+
+#define pfn_to_page(pfn)	(mem_map + (pfn))
+#define page_to_pfn(page)	((unsigned long)((page) - mem_map))
+#define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr-phys_base) >> PAGE_SHIFT)
+#define pfn_valid(pfn)		((pfn) < max_mapnr)
+#define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr-phys_base) >> PAGE_SHIFT)
 
 #define virt_to_phys __pa
 #define phys_to_virt __va
--- linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1/arch/sparc64/kernel/ioctl32.c	Sun May  5 20:37:59 2002
+++ linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1+sparc64-1/arch/sparc64/kernel/ioctl32.c	Mon May  6 11:17:15 2002
@@ -4553,8 +4553,8 @@
 COMPATIBLE_IOCTL(HCIDEVUP)
 COMPATIBLE_IOCTL(HCIDEVDOWN)
 COMPATIBLE_IOCTL(HCIDEVRESET)
-COMPATIBLE_IOCTL(HCIRESETSTAT)
-COMPATIBLE_IOCTL(HCIGETINFO)
+/* COMPATIBLE_IOCTL(HCIRESETSTAT) */
+/* COMPATIBLE_IOCTL(HCIGETINFO) */
 COMPATIBLE_IOCTL(HCIGETDEVLIST)
 COMPATIBLE_IOCTL(HCISETRAW)
 COMPATIBLE_IOCTL(HCISETSCAN)
--- linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1/include/asm-sparc64/pgtable.h	Sun May  5 20:37:53 2002
+++ linux-2.5.14+kbuild-v2.1+common-1+core-11+i386-1+sparc64-1/include/asm-sparc64/pgtable.h	Tue May  7 09:41:53 2002
@@ -194,13 +194,22 @@
 extern struct page *mem_map_zero;
 #define ZERO_PAGE(vaddr)	(mem_map_zero)
 
+#if 0
 /* Warning: These take pointers to page structs now... */
 #define mk_pte(page, pgprot)		\
 	__pte((((page - mem_map) << PAGE_SHIFT)+phys_base) | pgprot_val(pgprot) | _PAGE_SZBITS)
+#endif
+
+#define pfn_pte(pfn, pgprot)		\
+	__pte((((pfn) << PAGE_SHIFT)+phys_base) | pgprot_val(pgprot) | _PAGE_SZBITS)
+#define mk_pte(page, pgprot)	pfn_pte(page_to_pfn(page), (pgprot))
+
 #define page_pte_prot(page, prot)	mk_pte(page, prot)
 #define page_pte(page)			page_pte_prot(page, __pgprot(0))
 
+#if 0
 #define mk_pte_phys(physpage, pgprot)	(__pte((physpage) | pgprot_val(pgprot) | _PAGE_SZBITS))
+#endif
 
 extern inline pte_t pte_modify(pte_t orig_pte, pgprot_t new_prot)
 {
@@ -246,7 +255,12 @@
 /* Permanent address of a page. */
 #define __page_address(page)	page_address(page)
 
+#if 0
 #define pte_page(x) (mem_map+(((pte_val(x)&_PAGE_PADDR)-phys_base)>>PAGE_SHIFT))
+#endif
+
+#define pte_page(x) pfn_to_page(pte_pfn(x))
+#define pte_pfn(x) (((pte_val(x)&_PAGE_PADDR)-phys_base)>>PAGE_SHIFT)
 
 /* Be very careful when you change these three, they are delicate. */
 #define pte_mkyoung(pte)	(__pte(pte_val(pte) | _PAGE_ACCESSED | _PAGE_R))

[-- Attachment #3: kbuild-2.5-sparc64-2.5.14-1.bz2 --]
[-- Type: application/octet-stream, Size: 6641 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread
* pfn-Functionset out of order for sparc64 in current Bk tree?
@ 2002-05-07 19:04 Thunder from the hill
  2002-05-07 19:22 ` Roman Zippel
  0 siblings, 1 reply; 11+ messages in thread
From: Thunder from the hill @ 2002-05-07 19:04 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

Someone introduced, by Linus' request I remember, pfn_valid() instead of 
PAGE_INVALID() and such. Now I try to compile on Sparc, and /mm/memory.c 
is the first file which hits missing macros: pte_pfn, pfn_valid, 
pfn_to_page nd pfn_pte. I grepped for some declaration and hit only the 
two in the two-/three-level pagetable of i386. The only other occurrences 
of pte_pfn in *.[ch] were uses, not declarations. Global grep returned 
only two more occurrences in the Changeset.

 - pfn_to_page(pfn) is declared as (mem_map + (pfn)) for i386. Can this 
   apply to Sparc64 as well?
 - pte_pfn(x) is declared as
   ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
   in 2-level pgtable,
   (((x).pte_low >> PAGE_SHIFT) | ((x).pte_high << (32 - PAGE_SHIFT)))
   in 3-level. I suppose 2-level shouldn't exactly match here, how far 
   must the 3-level version be changed in order to fit sparc64? A lot?
 - pfn_valid(pfn) is described as ((pfn) < max_mapnr). Suppose this is OK 
   on Sparc64 either?
 - pfn_pte(page,prot) is defined as
   __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
   How far does this go for Sparc64?

The compile error was:

# sparc64-linux-gcc -D__KERNEL__ -I/usr/src/thunder-2.5/include -Wall 
-Wstrict-pr\ototypes -Wno-trigraphs -O2  -fno-strict-aliasing -fno-common 
-m64 -pipe -mno-f\pu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 
-fcall-used-g5 -fcall-used-g7 -W\no-sign-compare -Wa,--undeclared-regs -pg 
-DKBUILD_BASENAME=memory  -c -o mm/m\emory.o mm/memory.c
mm/memory.c: In function `__free_pte':
mm/memory.c:80: warning: implicit declaration of function `pte_pfn'
mm/memory.c:81: warning: implicit declaration of function `pfn_valid'
mm/memory.c:83: warning: implicit declaration of function `pfn_to_page'
mm/memory.c:83: warning: assignment makes pointer from integer without a 
cast
mm/memory.c: In function `copy_page_range':
mm/memory.c:289: warning: assignment makes pointer from integer without a 
cast
mm/memory.c: In function `zap_pte_range':
mm/memory.c:369: warning: assignment makes pointer from integer without a 
cast
mm/memory.c: In function `follow_page':
mm/memory.c:490: warning: return makes pointer from integer without a cast
mm/memory.c: In function `remap_pte_range':
mm/memory.c:879: invalid type argument of `->'
mm/memory.c:880: warning: implicit declaration of function `pfn_pte'
mm/memory.c: In function `do_wp_page':
mm/memory.c:996: warning: assignment makes pointer from integer without a 
cast

							       Regards,
								Thunder
--
if (errno == ENOTAVAIL)
    fprintf(stderr, "Error: Talking to Microsoft server!\n");



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

end of thread, other threads:[~2002-05-07 23:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-07 19:12 pfn-Functionset out of order for sparc64 in current Bk tree? Holzrichter, Bruce
2002-05-07 19:27 ` Jan-Benedict Glaw
2002-05-07 23:08   ` Roman Zippel
  -- strict thread matches above, loose matches on Subject: below --
2002-05-07 19:04 Thunder from the hill
2002-05-07 19:22 ` Roman Zippel
2002-05-07 20:43   ` Thunder from the hill
2002-05-07 21:12     ` David S. Miller
2002-05-07 21:08   ` David S. Miller
2002-05-07 21:52     ` Thunder from the hill
2002-05-07 21:44       ` David S. Miller
2002-05-07 23:11     ` Roman Zippel

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.