/* * Document me. */ void __init iSeries_setup_arch(void) { void * eventStack; unsigned procIx = get_paca()->xLpPaca.xDynHvPhysicalProcIndex; /* Setup the Lp Event Queue */ /* Allocate a page for the Event Stack * The hypervisor wants the absolute real address, so * we subtract out the KERNELBASE and add in the * absolute real address of the kernel load area */ eventStack = alloc_bootmem_pages( LpEventStackSize ); memset( eventStack, 0, LpEventStackSize ); /* Invoke the hypervisor to initialize the event stack */ HvCallEvent_setLpEventStack( 0, eventStack, LpEventStackSize ); /* Initialize fields in our Lp Event Queue */ xItLpQueue.xSlicEventStackPtr = (char *)eventStack; xItLpQueue.xSlicCurEventPtr = (char *)eventStack; xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack + (LpEventStackSize - LpEventMaxSize); xItLpQueue.xIndex = 0; /* Compute processor frequency */ procFreqHz = (((1UL<<34) * 1000000) / xIoHriProcessorVpd[procIx].xProcFreq ); procFreqMhz = procFreqHz / 1000000; procFreqMhzHundreths = (procFreqHz/10000) - (procFreqMhz*100); ppc_proc_freq = procFreqHz; /* Compute time base frequency */ tbFreqHz = (((1UL<<32) * 1000000) / xIoHriProcessorVpd[procIx].xTimeBaseFreq ); tbFreqMhz = tbFreqHz / 1000000; tbFreqMhzHundreths = (tbFreqHz/10000) - (tbFreqMhz*100); ppc_tb_freq = tbFreqHz; printk("Max logical processors = %d\n", itVpdAreas.xSlicMaxLogicalProcs ); printk("Max physical processors = %d\n", itVpdAreas.xSlicMaxPhysicalProcs ); printk("Processor frequency = %lu.%02lu\n", procFreqMhz, procFreqMhzHundreths ); printk("Time base frequency = %lu.%02lu\n", tbFreqMhz, tbFreqMhzHundreths ); printk("Processor version = %x\n", xIoHriProcessorVpd[procIx].xPVR ); }
/* * Document me. */ static void __init iSeries_setup_arch(void) { void *eventStack; unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; /* Add an eye catcher and the systemcfg layout version number */ strcpy(systemcfg->eye_catcher, "SYSTEMCFG:PPC64"); systemcfg->version.major = SYSTEMCFG_MAJOR; systemcfg->version.minor = SYSTEMCFG_MINOR; /* Setup the Lp Event Queue */ /* Allocate a page for the Event Stack * The hypervisor wants the absolute real address, so * we subtract out the KERNELBASE and add in the * absolute real address of the kernel load area */ eventStack = alloc_bootmem_pages(LpEventStackSize); memset(eventStack, 0, LpEventStackSize); /* Invoke the hypervisor to initialize the event stack */ HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize); /* Initialize fields in our Lp Event Queue */ xItLpQueue.xSlicEventStackPtr = (char *)eventStack; xItLpQueue.xSlicCurEventPtr = (char *)eventStack; xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack + (LpEventStackSize - LpEventMaxSize); xItLpQueue.xIndex = 0; /* Compute processor frequency */ procFreqHz = ((1UL << 34) * 1000000) / xIoHriProcessorVpd[procIx].xProcFreq; procFreqMhz = procFreqHz / 1000000; procFreqMhzHundreths = (procFreqHz / 10000) - (procFreqMhz * 100); ppc_proc_freq = procFreqHz; /* Compute time base frequency */ tbFreqHz = ((1UL << 32) * 1000000) / xIoHriProcessorVpd[procIx].xTimeBaseFreq; tbFreqMhz = tbFreqHz / 1000000; tbFreqMhzHundreths = (tbFreqHz / 10000) - (tbFreqMhz * 100); ppc_tb_freq = tbFreqHz; printk("Max logical processors = %d\n", itVpdAreas.xSlicMaxLogicalProcs); printk("Max physical processors = %d\n", itVpdAreas.xSlicMaxPhysicalProcs); printk("Processor frequency = %lu.%02lu\n", procFreqMhz, procFreqMhzHundreths); printk("Time base frequency = %lu.%02lu\n", tbFreqMhz, tbFreqMhzHundreths); systemcfg->processor = xIoHriProcessorVpd[procIx].xPVR; printk("Processor version = %x\n", systemcfg->processor); }
void __init setup_hvlpevent_queue(void) { void *eventStack; spin_lock_init(&hvlpevent_queue.hq_lock); /* Allocate a page for the Event Stack. */ eventStack = alloc_bootmem_pages(IT_LP_EVENT_STACK_SIZE); memset(eventStack, 0, IT_LP_EVENT_STACK_SIZE); /* Invoke the hypervisor to initialize the event stack */ HvCallEvent_setLpEventStack(0, eventStack, IT_LP_EVENT_STACK_SIZE); hvlpevent_queue.hq_event_stack = eventStack; hvlpevent_queue.hq_current_event = eventStack; hvlpevent_queue.hq_last_event = (char *)eventStack + (IT_LP_EVENT_STACK_SIZE - IT_LP_EVENT_MAX_SIZE); hvlpevent_queue.hq_index = 0; }