[parisc-linux-cvs] DIFF -pa33 CONFIG_PA20 vs __LP64__

Grant Grundler grundler@puffin.external.hp.com
Wed, 3 Oct 2001 18:19:15 -0600


Fix CONFIG_PA20 vs __LP64__ ifdef usage in a few places.
Can once again build 32-bit kernel with CONFIG_PA20=y.

grant

Index: Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/Makefile,v
retrieving revision 1.144
diff -u -p -r1.144 Makefile
--- Makefile	2001/10/03 08:06:38	1.144
+++ Makefile	2001/10/04 00:16:15
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 9
-EXTRAVERSION = -pa32
+EXTRAVERSION = -pa33
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: arch/parisc/kernel/firmware.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/firmware.c,v
retrieving revision 1.31
diff -u -p -r1.31 firmware.c
--- firmware.c	2001/10/02 20:58:42	1.31
+++ firmware.c	2001/10/04 00:16:15
@@ -409,9 +409,7 @@ int pdc_btlb_info(struct pdc_btlb_info *
         }
         return retval;
 }
-#endif
 
-#ifndef __LP64__
 /**
  * pdc_mem_map_hpa - Find fixed module information.  
  * @address: The return buffer
@@ -424,19 +422,21 @@ int pdc_btlb_info(struct pdc_btlb_info *
  *
  * This call is supported by all existing S700 workstations (up to  Gecko).
  */
-int pdc_mem_map_hpa(struct pdc_memory_map *address, struct pdc_module_path *mod_path)
+int pdc_mem_map_hpa(struct pdc_memory_map *address,
+		struct pdc_module_path *mod_path)
 {
         int retval;
 
         spin_lock_irq(&pdc_lock);
         memcpy(pdc_result2, mod_path, sizeof(*mod_path));
-        retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result), __pa(pdc_result2));
+        retval = mem_pdc_call(PDC_MEM_MAP, PDC_MEM_MAP_HPA, __pa(pdc_result),
+				__pa(pdc_result2));
         memcpy(address, pdc_result, sizeof(*address));
         spin_unlock_irq(&pdc_lock);
 
         return retval;
 }
-#endif
+#endif	/* !CONFIG_PA20 */
 
 /**
  * pdc_lan_station_id - Get the LAN address.
@@ -546,8 +546,8 @@ int pdc_tod_set(unsigned long sec, unsig
 }
 
 #ifdef __LP64__
-int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl, 
-		      unsigned long entries)
+int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
+		struct pdc_memory_table *tbl, unsigned long entries)
 {
 	int retval;
 
@@ -560,7 +560,7 @@ int pdc_mem_mem_table(struct pdc_memory_
 
 	return retval;
 }
-#endif
+#endif /* __LP64__ */
 
 /* FIXME: Is this pdc used?  I could not find type reference to ftc_bitmap
  * so I guessed at unsigned long.  Someone who knows what this does, can fix
@@ -785,7 +785,7 @@ int pdc_pat_pd_get_addr_map(unsigned lon
 
 	return retval;
 }
-#endif
+#endif /* __LP64__ */
 
 
 /***************** 32-bit real-mode calls ***********/
@@ -894,5 +894,5 @@ static long real64_call(unsigned long fn
 	return real64_call_asm(&real_stack.sp, &real_stack.arg0, fn);
 }
 
-#endif
+#endif /* __LP64__ */
 
Index: arch/parisc/kernel/inventory.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v
retrieving revision 1.36
diff -u -p -r1.36 inventory.c
--- inventory.c	2001/09/26 18:15:18	1.36
+++ inventory.c	2001/10/04 00:16:15
@@ -155,9 +155,7 @@ void __init do_pagezero_memconfig(void)
 
 #ifdef __LP64__
 
-#define do_legacy_inventory() 0
-
-/* All of the PDC PAT specific code goes here */
+/* All of the PDC PAT specific code is 64-bit only */
 
 /*
 **  The module object is filled via PDC_PAT_CELL[Return Cell Module].
@@ -369,7 +367,6 @@ static int __init do_pat_inventory(void)
 }
 
 /* We only look for extended memory ranges on a 64 bit capable box */
-
 static void __init do_system_map_memconfig(void)
 {
 	struct pdc_memory_table_raddr r_addr;
@@ -417,6 +414,11 @@ static void __init do_system_map_memconf
 #define do_pat_memconfig() do { } while (0)
 #define do_system_map_memconfig() do_pagezero_memconfig()
 
+#endif	/* !__LP64__ */
+
+
+#ifndef CONFIG_PA20
+
 /* All of the older legacy box (32 bit only) code goes here */
 
 static struct parisc_device * __init 
@@ -481,16 +483,19 @@ int __init do_legacy_inventory(void)
 
 	return num;
 }
-#endif  /* !__LP64__ */
+
+#else /* CONFIG_PA20 */
+#define do_legacy_inventory() 0
+#endif  /* CONFIG_PA20 */
 
 /* Common 32/64 bit based code goes here */
 
 /* Fixed Physical Address - Location of the Central Bus */
 #define FPA (unsigned long)(signed int)0xFFF80000
 
-/* The fixed portion is contained in hpa[14..19] for 32 bit and hpa[46..51] for 64 bit.
-** The maximum number of native devices is 2^6 (64) and the offset between devices is
-** 2^12 (0x1000).
+/* The fixed portion is contained in hpa[14..19] for 32 bit and
+** hpa[46..51] for 64 bit.  The maximum number of native devices
+** is 2^6 (64) and the offset between devices is 2^12 (0x1000).
 ** - Ryan
 */
 #define MAX_NATIVE_DEVICES 64
Index: include/asm-parisc/pdc.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pdc.h,v
retrieving revision 1.32
diff -u -p -r1.32 pdc.h
--- pdc.h	2001/10/02 20:58:43	1.32
+++ pdc.h	2001/10/04 00:16:15
@@ -505,7 +505,8 @@ struct pdc_btlb_info {	/* PDC_BLOCK_TLB,
 	struct pdc_btlb_info_range fixed_range_info;
 	struct pdc_btlb_info_range variable_range_info;
 };
-#endif
+
+#endif /* !CONFIG_PA20 */
 
 #ifdef __LP64__
 struct pdc_memory_table_raddr { /* PDC_MEM/PDC_MEM_TABLE (return info) */
@@ -518,7 +519,7 @@ struct pdc_memory_table {       /* PDC_M
 	unsigned int  pages;
 	unsigned int  reserved;
 };
-#endif
+#endif /* __LP64__ */
 
 struct pdc_system_map_mod_info { /* PDC_SYSTEM_MAP/FIND_MODULE */
 	unsigned long mod_addr;
@@ -587,7 +588,7 @@ struct pdc_pat_cell_mod_maddr_block {	/*
 };
 
 typedef struct pdc_pat_cell_mod_maddr_block pdc_pat_cell_mod_maddr_block_t;
-#endif
+#endif /* __LP64__ */
 
 /* architected results from PDC_PIM/transfer hpmc on a PA1.1 machine */
 
@@ -815,7 +816,7 @@ int pdc_cache_info(struct pdc_cache_info
 #ifndef CONFIG_PA20
 int pdc_btlb_info(struct pdc_btlb_info *btlb);
 int pdc_mem_map_hpa(struct pdc_memory_map *r_addr, struct pdc_module_path *mod_path);
-#endif
+#endif /* !CONFIG_PA20 */
 int pdc_lan_station_id(char *lan_addr, unsigned long net_hpa);
 
 int pdc_pci_irt_size(unsigned long *num_entries, unsigned long hpa);
@@ -825,8 +826,8 @@ int pdc_tod_read(struct pdc_tod *tod);
 int pdc_tod_set(unsigned long sec, unsigned long usec);
 
 #ifdef __LP64__
-int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr, struct pdc_memory_table *tbl, 
-		      unsigned long entries);
+int pdc_mem_mem_table(struct pdc_memory_table_raddr *r_addr,
+		struct pdc_memory_table *tbl, unsigned long entries);
 #endif
 
 int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
@@ -876,11 +877,11 @@ int pdc_pat_pd_get_addr_map(unsigned lon
 #define PAT_GET_IOC(value)	(((value) >> 40) & 0xffUL)
 #define PAT_GET_MOD_PAGES(value)(((value) & 0xffffffUL)
 
-#else
+#else /* !__LP64__ */
 /* No PAT support for 32-bit kernels...sorry */
 #define pdc_pat_get_irt_size(num_entries, cell_numn)	PDC_RET_NE_PROC
 #define pdc_pat_get_irt(r_addr, cell_num)	PDC_RET_NE_PROC
-#endif
+#endif /* !__LP64__ */
 
 extern void pdc_init(void);