Example #1
0
int main(void)
{
        char cpuid[100];
        getcpuid(cpuid);
        printf("cpuid is %s\\n",cpuid);
        return 0;
}
Example #2
0
void Jcmd_apic_test(void *arg1,void *arg2){
	int duration=TICKS_PER_SECOND;
	if (getcpuid() != 0) {
		set_local_apic_timer(LOCAL_TIMER_CPU_IRQ_VEC, duration);
		ut_printf(" increased timer by 10 times :  durastion:%d \n",duration);
	}else{
		ut_printf(" cpu is boot cpu duration:%d \n",duration);
	}
}
Example #3
0
static int
get_cpu_mhz()
{
	processor_info_t pinfo;

	if (processor_info(getcpuid(), &pinfo) == -1) {
		perror("failed to get processor info");
		exit(1);
	}

	return (pinfo.pi_clock);
}
Example #4
0
int proc_get_cpuid (void)
{
#ifdef _LINUX_
    int i, ret;
    cpu_set_t cpu_set;
    
    ret = sched_getaffinity (0, sizeof (cpu_set), &cpu_set);
    if (ret < 0) return -1;

    for (i = 0; i < CPU_SETSIZE; ++i)
    {
        if (CPU_ISSET (i, &cpu_set)) break;
    }
    return i;
#elif defined (_SOLARIS_)
    return getcpuid ();
#endif
}
Example #5
0
void
main() {
	uint j=0,i=0,k=0;
	uint rev;
	ulong pc;

	pc = getpc();
	pl011_addr((void *)pc, 1);
	pl011_puts("Entered main() at ");
	pl011_addr(&main, 0);
	pl011_puts(" with SP=");
	pl011_addr((void *)getsp(), 0);
	pl011_puts(" with SC=");
	pl011_addr((void *)getsc(), 0);
	pl011_puts(" with CPSR=");
	pl011_addr((void *)getcpsr(), 0);
	pl011_puts(" with SPSR=");
	pl011_addr((void *)getspsr(), 1);

	pl011_puts("Clearing Mach:  ");
	memset(m, 0, sizeof(Mach));
	pl011_addr((char *)m,		0); pl011_puts("-");
	pl011_addr((char *)(m+1),	1);

	pl011_puts("Clearing edata: ");
	memset(edata, 0, end-edata);
	pl011_addr((char *)&edata,	0); pl011_puts("-");
	pl011_addr((char *)&end,	1);

	conf.nmach = 1;

	quotefmtinstall();
	confinit();
	mmuinit1();
	xinit();
	poolinit();
	poolsizeinit();
	//uartconsinit();
	screeninit();
	trapinit();
	timersinit();
	clockinit();
	printinit();
	swcursorinit();

	rev = getfirmware();
	print("\nARM %ld MHz id %8.8lux firmware: rev %d, mem: %ld\n"
		,(m->cpuhz+500000)/1000000, getcpuid(), rev, conf.topofmem/MB);
	print("Inferno OS %s Vita Nuova\n", VERSION);
	print("Ported to Raspberry Pi (BCM2835) by LynxLine\n\n");

	procinit();
	links();
	chandevreset();

	eve = strdup("inferno");

	userinit();
	schedinit();

	pl011_puts("to inifinite loop\n\n");
	for (;;);
}
Example #6
0
uint8_t apic_get_task_priority()
{
	ut_printf("  prio: %x register :%x cpuid:%d \n,",local_apic->tpr.reg ,local_apic->tpr.priority,getcpuid());
	return local_apic->tpr.priority ;
}