[PATCH 3/15] ppc64: Reorganise the paca initialisation macros

Michael Ellerman michael at ellerman.id.au
Tue Jun 28 09:17:09 EST 2005


Hi,

This patch updates the macros that initialise the paca to remove the lpq
parameter. It also rearranges them a bit with the hope of making them a
bit clearer.


Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
--

 arch/ppc64/kernel/pacaData.c |  306 ++++++++++++++++++++++---------------------
 1 files changed, 160 insertions(+), 146 deletions(-)

Index: work/arch/ppc64/kernel/pacaData.c
===================================================================
--- work.orig/arch/ppc64/kernel/pacaData.c
+++ work/arch/ppc64/kernel/pacaData.c
@@ -42,20 +42,7 @@ extern unsigned long __toc_start;
  * processors.  The processor VPD array needs one entry per physical
  * processor (not thread).
  */
-#ifdef CONFIG_PPC_ISERIES
-#define EXTRA_INITS(number, lpq)					    \
-	.lppaca_ptr = &paca[number].lppaca,				    \
-	.reg_save_ptr = &paca[number].reg_save,				    \
-	.reg_save = {							    \
-		.xDesc = 0xd397d9e2,	/* "LpRS" */			    \
-		.xSize = sizeof(struct ItLpRegSave)			    \
-	},
-#else
-#define EXTRA_INITS(number, lpq)
-#endif
-
-#define PACAINITDATA(number,start,lpq,asrr,asrv)			    \
-{									    \
+#define PACA_INIT_COMMON(number, start, asrr, asrv)			    \
 	.lock_token = 0x8000,						    \
 	.paca_index = (number),		/* Paca Index */		    \
 	.default_decr = 0x00ff0000,	/* Initial Decr */		    \
@@ -73,147 +60,174 @@ extern unsigned long __toc_start;
 		.end_of_quantum = 0xfffffffffffffffful,			    \
 		.slb_count = 64,					    \
 	},								    \
-	EXTRA_INITS((number), (lpq))					    \
-}
 
-struct paca_struct paca[] = {
 #ifdef CONFIG_PPC_ISERIES
-	PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR),
+#define PACA_INIT_ISERIES(number)					    \
+	.lppaca_ptr = &paca[number].lppaca,				    \
+	.reg_save_ptr = &paca[number].reg_save,				    \
+	.reg_save = {							    \
+		.xDesc = 0xd397d9e2,	/* "LpRS" */			    \
+		.xSize = sizeof(struct ItLpRegSave)			    \
+	}
+
+#define PACAINITDATA(number)						    \
+{									    \
+	PACA_INIT_COMMON(number, 0, 0, 0)				    \
+	PACA_INIT_ISERIES(number)					    \
+}
+
+#define BOOTCPU_PACAINITDATA(number)					    \
+{									    \
+	PACA_INIT_COMMON(number, 1, 0, STAB0_VIRT_ADDR)			    \
+	PACA_INIT_ISERIES(number)					    \
+}
+
 #else
-	PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR),
+#define PACAINITDATA(number)						    \
+{									    \
+	PACA_INIT_COMMON(number, 0, 0, 0)				    \
+}
+
+#define BOOTCPU_PACAINITDATA(number)					    \
+{									    \
+	PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR)	    \
+}
 #endif
+
+struct paca_struct paca[] = {
+	BOOTCPU_PACAINITDATA(0),
 #if NR_CPUS > 1
-	PACAINITDATA( 1, 0, NULL, 0, 0),
-	PACAINITDATA( 2, 0, NULL, 0, 0),
-	PACAINITDATA( 3, 0, NULL, 0, 0),
+	PACAINITDATA(1),
+	PACAINITDATA(2),
+	PACAINITDATA(3),
 #if NR_CPUS > 4
-	PACAINITDATA( 4, 0, NULL, 0, 0),
-	PACAINITDATA( 5, 0, NULL, 0, 0),
-	PACAINITDATA( 6, 0, NULL, 0, 0),
-	PACAINITDATA( 7, 0, NULL, 0, 0),
+	PACAINITDATA(4),
+	PACAINITDATA(5),
+	PACAINITDATA(6),
+	PACAINITDATA(7),
 #if NR_CPUS > 8
-	PACAINITDATA( 8, 0, NULL, 0, 0),
-	PACAINITDATA( 9, 0, NULL, 0, 0),
-	PACAINITDATA(10, 0, NULL, 0, 0),
-	PACAINITDATA(11, 0, NULL, 0, 0),
-	PACAINITDATA(12, 0, NULL, 0, 0),
-	PACAINITDATA(13, 0, NULL, 0, 0),
-	PACAINITDATA(14, 0, NULL, 0, 0),
-	PACAINITDATA(15, 0, NULL, 0, 0),
-	PACAINITDATA(16, 0, NULL, 0, 0),
-	PACAINITDATA(17, 0, NULL, 0, 0),
-	PACAINITDATA(18, 0, NULL, 0, 0),
-	PACAINITDATA(19, 0, NULL, 0, 0),
-	PACAINITDATA(20, 0, NULL, 0, 0),
-	PACAINITDATA(21, 0, NULL, 0, 0),
-	PACAINITDATA(22, 0, NULL, 0, 0),
-	PACAINITDATA(23, 0, NULL, 0, 0),
-	PACAINITDATA(24, 0, NULL, 0, 0),
-	PACAINITDATA(25, 0, NULL, 0, 0),
-	PACAINITDATA(26, 0, NULL, 0, 0),
-	PACAINITDATA(27, 0, NULL, 0, 0),
-	PACAINITDATA(28, 0, NULL, 0, 0),
-	PACAINITDATA(29, 0, NULL, 0, 0),
-	PACAINITDATA(30, 0, NULL, 0, 0),
-	PACAINITDATA(31, 0, NULL, 0, 0),
+	PACAINITDATA(8),
+	PACAINITDATA(9),
+	PACAINITDATA(10),
+	PACAINITDATA(11),
+	PACAINITDATA(12),
+	PACAINITDATA(13),
+	PACAINITDATA(14),
+	PACAINITDATA(15),
+	PACAINITDATA(16),
+	PACAINITDATA(17),
+	PACAINITDATA(18),
+	PACAINITDATA(19),
+	PACAINITDATA(20),
+	PACAINITDATA(21),
+	PACAINITDATA(22),
+	PACAINITDATA(23),
+	PACAINITDATA(24),
+	PACAINITDATA(25),
+	PACAINITDATA(26),
+	PACAINITDATA(27),
+	PACAINITDATA(28),
+	PACAINITDATA(29),
+	PACAINITDATA(30),
+	PACAINITDATA(31),
 #if NR_CPUS > 32
-	PACAINITDATA(32, 0, NULL, 0, 0),
-	PACAINITDATA(33, 0, NULL, 0, 0),
-	PACAINITDATA(34, 0, NULL, 0, 0),
-	PACAINITDATA(35, 0, NULL, 0, 0),
-	PACAINITDATA(36, 0, NULL, 0, 0),
-	PACAINITDATA(37, 0, NULL, 0, 0),
-	PACAINITDATA(38, 0, NULL, 0, 0),
-	PACAINITDATA(39, 0, NULL, 0, 0),
-	PACAINITDATA(40, 0, NULL, 0, 0),
-	PACAINITDATA(41, 0, NULL, 0, 0),
-	PACAINITDATA(42, 0, NULL, 0, 0),
-	PACAINITDATA(43, 0, NULL, 0, 0),
-	PACAINITDATA(44, 0, NULL, 0, 0),
-	PACAINITDATA(45, 0, NULL, 0, 0),
-	PACAINITDATA(46, 0, NULL, 0, 0),
-	PACAINITDATA(47, 0, NULL, 0, 0),
-	PACAINITDATA(48, 0, NULL, 0, 0),
-	PACAINITDATA(49, 0, NULL, 0, 0),
-	PACAINITDATA(50, 0, NULL, 0, 0),
-	PACAINITDATA(51, 0, NULL, 0, 0),
-	PACAINITDATA(52, 0, NULL, 0, 0),
-	PACAINITDATA(53, 0, NULL, 0, 0),
-	PACAINITDATA(54, 0, NULL, 0, 0),
-	PACAINITDATA(55, 0, NULL, 0, 0),
-	PACAINITDATA(56, 0, NULL, 0, 0),
-	PACAINITDATA(57, 0, NULL, 0, 0),
-	PACAINITDATA(58, 0, NULL, 0, 0),
-	PACAINITDATA(59, 0, NULL, 0, 0),
-	PACAINITDATA(60, 0, NULL, 0, 0),
-	PACAINITDATA(61, 0, NULL, 0, 0),
-	PACAINITDATA(62, 0, NULL, 0, 0),
-	PACAINITDATA(63, 0, NULL, 0, 0),
+	PACAINITDATA(32),
+	PACAINITDATA(33),
+	PACAINITDATA(34),
+	PACAINITDATA(35),
+	PACAINITDATA(36),
+	PACAINITDATA(37),
+	PACAINITDATA(38),
+	PACAINITDATA(39),
+	PACAINITDATA(40),
+	PACAINITDATA(41),
+	PACAINITDATA(42),
+	PACAINITDATA(43),
+	PACAINITDATA(44),
+	PACAINITDATA(45),
+	PACAINITDATA(46),
+	PACAINITDATA(47),
+	PACAINITDATA(48),
+	PACAINITDATA(49),
+	PACAINITDATA(50),
+	PACAINITDATA(51),
+	PACAINITDATA(52),
+	PACAINITDATA(53),
+	PACAINITDATA(54),
+	PACAINITDATA(55),
+	PACAINITDATA(56),
+	PACAINITDATA(57),
+	PACAINITDATA(58),
+	PACAINITDATA(59),
+	PACAINITDATA(60),
+	PACAINITDATA(61),
+	PACAINITDATA(62),
+	PACAINITDATA(63),
 #if NR_CPUS > 64
-	PACAINITDATA(64, 0, NULL, 0, 0),
-	PACAINITDATA(65, 0, NULL, 0, 0),
-	PACAINITDATA(66, 0, NULL, 0, 0),
-	PACAINITDATA(67, 0, NULL, 0, 0),
-	PACAINITDATA(68, 0, NULL, 0, 0),
-	PACAINITDATA(69, 0, NULL, 0, 0),
-	PACAINITDATA(70, 0, NULL, 0, 0),
-	PACAINITDATA(71, 0, NULL, 0, 0),
-	PACAINITDATA(72, 0, NULL, 0, 0),
-	PACAINITDATA(73, 0, NULL, 0, 0),
-	PACAINITDATA(74, 0, NULL, 0, 0),
-	PACAINITDATA(75, 0, NULL, 0, 0),
-	PACAINITDATA(76, 0, NULL, 0, 0),
-	PACAINITDATA(77, 0, NULL, 0, 0),
-	PACAINITDATA(78, 0, NULL, 0, 0),
-	PACAINITDATA(79, 0, NULL, 0, 0),
-	PACAINITDATA(80, 0, NULL, 0, 0),
-	PACAINITDATA(81, 0, NULL, 0, 0),
-	PACAINITDATA(82, 0, NULL, 0, 0),
-	PACAINITDATA(83, 0, NULL, 0, 0),
-	PACAINITDATA(84, 0, NULL, 0, 0),
-	PACAINITDATA(85, 0, NULL, 0, 0),
-	PACAINITDATA(86, 0, NULL, 0, 0),
-	PACAINITDATA(87, 0, NULL, 0, 0),
-	PACAINITDATA(88, 0, NULL, 0, 0),
-	PACAINITDATA(89, 0, NULL, 0, 0),
-	PACAINITDATA(90, 0, NULL, 0, 0),
-	PACAINITDATA(91, 0, NULL, 0, 0),
-	PACAINITDATA(92, 0, NULL, 0, 0),
-	PACAINITDATA(93, 0, NULL, 0, 0),
-	PACAINITDATA(94, 0, NULL, 0, 0),
-	PACAINITDATA(95, 0, NULL, 0, 0),
-	PACAINITDATA(96, 0, NULL, 0, 0),
-	PACAINITDATA(97, 0, NULL, 0, 0),
-	PACAINITDATA(98, 0, NULL, 0, 0),
-	PACAINITDATA(99, 0, NULL, 0, 0),
-	PACAINITDATA(100, 0, NULL, 0, 0),
-	PACAINITDATA(101, 0, NULL, 0, 0),
-	PACAINITDATA(102, 0, NULL, 0, 0),
-	PACAINITDATA(103, 0, NULL, 0, 0),
-	PACAINITDATA(104, 0, NULL, 0, 0),
-	PACAINITDATA(105, 0, NULL, 0, 0),
-	PACAINITDATA(106, 0, NULL, 0, 0),
-	PACAINITDATA(107, 0, NULL, 0, 0),
-	PACAINITDATA(108, 0, NULL, 0, 0),
-	PACAINITDATA(109, 0, NULL, 0, 0),
-	PACAINITDATA(110, 0, NULL, 0, 0),
-	PACAINITDATA(111, 0, NULL, 0, 0),
-	PACAINITDATA(112, 0, NULL, 0, 0),
-	PACAINITDATA(113, 0, NULL, 0, 0),
-	PACAINITDATA(114, 0, NULL, 0, 0),
-	PACAINITDATA(115, 0, NULL, 0, 0),
-	PACAINITDATA(116, 0, NULL, 0, 0),
-	PACAINITDATA(117, 0, NULL, 0, 0),
-	PACAINITDATA(118, 0, NULL, 0, 0),
-	PACAINITDATA(119, 0, NULL, 0, 0),
-	PACAINITDATA(120, 0, NULL, 0, 0),
-	PACAINITDATA(121, 0, NULL, 0, 0),
-	PACAINITDATA(122, 0, NULL, 0, 0),
-	PACAINITDATA(123, 0, NULL, 0, 0),
-	PACAINITDATA(124, 0, NULL, 0, 0),
-	PACAINITDATA(125, 0, NULL, 0, 0),
-	PACAINITDATA(126, 0, NULL, 0, 0),
-	PACAINITDATA(127, 0, NULL, 0, 0),
+	PACAINITDATA(64),
+	PACAINITDATA(65),
+	PACAINITDATA(66),
+	PACAINITDATA(67),
+	PACAINITDATA(68),
+	PACAINITDATA(69),
+	PACAINITDATA(70),
+	PACAINITDATA(71),
+	PACAINITDATA(72),
+	PACAINITDATA(73),
+	PACAINITDATA(74),
+	PACAINITDATA(75),
+	PACAINITDATA(76),
+	PACAINITDATA(77),
+	PACAINITDATA(78),
+	PACAINITDATA(79),
+	PACAINITDATA(80),
+	PACAINITDATA(81),
+	PACAINITDATA(82),
+	PACAINITDATA(83),
+	PACAINITDATA(84),
+	PACAINITDATA(85),
+	PACAINITDATA(86),
+	PACAINITDATA(87),
+	PACAINITDATA(88),
+	PACAINITDATA(89),
+	PACAINITDATA(90),
+	PACAINITDATA(91),
+	PACAINITDATA(92),
+	PACAINITDATA(93),
+	PACAINITDATA(94),
+	PACAINITDATA(95),
+	PACAINITDATA(96),
+	PACAINITDATA(97),
+	PACAINITDATA(98),
+	PACAINITDATA(99),
+	PACAINITDATA(100),
+	PACAINITDATA(101),
+	PACAINITDATA(102),
+	PACAINITDATA(103),
+	PACAINITDATA(104),
+	PACAINITDATA(105),
+	PACAINITDATA(106),
+	PACAINITDATA(107),
+	PACAINITDATA(108),
+	PACAINITDATA(109),
+	PACAINITDATA(110),
+	PACAINITDATA(111),
+	PACAINITDATA(112),
+	PACAINITDATA(113),
+	PACAINITDATA(114),
+	PACAINITDATA(115),
+	PACAINITDATA(116),
+	PACAINITDATA(117),
+	PACAINITDATA(118),
+	PACAINITDATA(119),
+	PACAINITDATA(120),
+	PACAINITDATA(121),
+	PACAINITDATA(122),
+	PACAINITDATA(123),
+	PACAINITDATA(124),
+	PACAINITDATA(125),
+	PACAINITDATA(126),
+	PACAINITDATA(127),
 #endif
 #endif
 #endif



More information about the Linuxppc64-dev mailing list