Commit f572f5e3 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: replace MAX_PACAS with NR_CPUS

parent 2b41d113
......@@ -864,7 +864,7 @@ static void iSeries_setup_dprofile(void)
{
if ( dprof_buffer ) {
unsigned i;
for (i=0; i<MAX_PACAS; ++i) {
for (i=0; i<NR_CPUS; ++i) {
paca[i].prof_shift = dprof_shift;
paca[i].prof_len = dprof_len-1;
paca[i].prof_buffer = dprof_buffer;
......
......@@ -676,7 +676,7 @@ static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
#ifdef CONFIG_PPC_ISERIES
{
unsigned i;
for (i=0; i<MAX_PACAS; ++i) {
for (i=0; i<NR_CPUS; ++i) {
if ( paca[i].prof_buffer && (new_value & 1) )
paca[i].prof_enabled = 1;
else
......
......@@ -64,7 +64,7 @@ struct systemcfg *systemcfg;
(&paca[number].exception_stack[0]) - EXC_FRAME_SIZE, \
}
struct paca_struct paca[MAX_PACAS] __page_aligned = {
struct paca_struct paca[NR_CPUS] __page_aligned = {
#ifdef CONFIG_PPC_ISERIES
PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR),
#else
......@@ -101,6 +101,7 @@ struct paca_struct paca[MAX_PACAS] __page_aligned = {
PACAINITDATA(29, 0, 0, 0, 0),
PACAINITDATA(30, 0, 0, 0, 0),
PACAINITDATA(31, 0, 0, 0, 0),
#if NR_CPUS > 32
PACAINITDATA(32, 0, 0, 0, 0),
PACAINITDATA(33, 0, 0, 0, 0),
PACAINITDATA(34, 0, 0, 0, 0),
......@@ -116,5 +117,22 @@ struct paca_struct paca[MAX_PACAS] __page_aligned = {
PACAINITDATA(44, 0, 0, 0, 0),
PACAINITDATA(45, 0, 0, 0, 0),
PACAINITDATA(46, 0, 0, 0, 0),
PACAINITDATA(47, 0, 0, 0, 0)
PACAINITDATA(47, 0, 0, 0, 0),
PACAINITDATA(48, 0, 0, 0, 0),
PACAINITDATA(49, 0, 0, 0, 0),
PACAINITDATA(50, 0, 0, 0, 0),
PACAINITDATA(51, 0, 0, 0, 0),
PACAINITDATA(52, 0, 0, 0, 0),
PACAINITDATA(53, 0, 0, 0, 0),
PACAINITDATA(54, 0, 0, 0, 0),
PACAINITDATA(55, 0, 0, 0, 0),
PACAINITDATA(56, 0, 0, 0, 0),
PACAINITDATA(57, 0, 0, 0, 0),
PACAINITDATA(58, 0, 0, 0, 0),
PACAINITDATA(59, 0, 0, 0, 0),
PACAINITDATA(60, 0, 0, 0, 0),
PACAINITDATA(61, 0, 0, 0, 0),
PACAINITDATA(62, 0, 0, 0, 0),
PACAINITDATA(63, 0, 0, 0, 0),
#endif
};
......@@ -585,7 +585,7 @@ int set_spread_lpevents( char * str )
/* The parameter is the number of processors to share in processing lp events */
unsigned long i;
unsigned long val = simple_strtoul( str, NULL, 0 );
if ( ( val > 0 ) && ( val <= MAX_PACAS ) ) {
if ( ( val > 0 ) && ( val <= NR_CPUS ) ) {
for ( i=1; i<val; ++i )
paca[i].lpQueuePtr = paca[0].lpQueuePtr;
printk("lpevent processing spread over %ld processors\n", val);
......
......@@ -113,7 +113,7 @@ static int smp_iSeries_numProcs(void)
struct ItLpPaca * lpPaca;
np = 0;
for (i=0; i < MAX_PACAS; ++i) {
for (i=0; i < NR_CPUS; ++i) {
lpPaca = paca[i].xLpPacaPtr;
if ( lpPaca->xDynProcStatus < 2 ) {
++np;
......@@ -128,7 +128,7 @@ static int smp_iSeries_probe(void)
unsigned np = 0;
struct ItLpPaca *lpPaca;
for (i=0; i < MAX_PACAS; ++i) {
for (i=0; i < NR_CPUS; ++i) {
lpPaca = paca[i].xLpPacaPtr;
if (lpPaca->xDynProcStatus < 2) {
paca[i].active = 1;
......@@ -144,7 +144,7 @@ static void smp_iSeries_kick_cpu(int nr)
struct ItLpPaca * lpPaca;
/* Verify we have a Paca for processor nr */
if ( ( nr <= 0 ) ||
( nr >= MAX_PACAS ) )
( nr >= NR_CPUS ) )
return;
/* Verify that our partition has a processor nr */
lpPaca = paca[nr].xLpPacaPtr;
......@@ -228,7 +228,7 @@ smp_kick_cpu(int nr)
{
/* Verify we have a Paca for processor nr */
if ( ( nr <= 0 ) ||
( nr >= MAX_PACAS ) )
( nr >= NR_CPUS ) )
return;
/* The information for processor bringup must
......
......@@ -33,17 +33,6 @@
#include <asm/mmu.h>
#include <asm/processor.h>
/* A paca entry is required for each logical processor. On systems
* that support hardware multi-threading, this is equal to twice the
* number of physical processors. On LPAR systems, we are required
* to have space for the maximum number of logical processors we
* could ever possibly have. Currently, we are limited to allocating
* 24 processors to a partition which gives 48 logical processors on
* an HMT box. Therefore, we reserve this many paca entries.
*/
#define MAX_PROCESSORS 24
#define MAX_PACAS MAX_PROCESSORS * 2
extern struct paca_struct paca[];
register struct paca_struct *local_paca asm("r13");
#define get_paca() local_paca
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment