int main(int argc, char **argv) { long i = 0; //Waiting counter long led = 0; //Bits to lit for (i=0; i<=3; i++) turnOffLed(i); init1sTimer0(); while (serial_getc_nb() > 255) { turnOffLed(led); led++; if (led == 4) led = 0; turnOnLed(led); launchAndWaitTimer0(); } return 0; }
static void h_get_term_char(struct cpu_user_regs *regs) { /* temporary hack to let us use xmon in dom0 */ extern char serial_getc_nb(int handle); char c; c = serial_getc_nb(0); if (c > 0) { regs->gprs[4] = 1; regs->gprs[5] = (ulong)c << (7 * 8); regs->gprs[6] = 0; /* paranoid */ } else { regs->gprs[4] = 0; } regs->gprs[3] = H_Success; }
int main(int argc, char **argv) { serial_init(); serial_puts("\r\nPortal - Still alive\r\n"); long *address = (long *)(&partition_begin); long allTime = 0; initPE6(); long time = *address; address ++; long duration = *address; address ++; long waveLenght = *address; short c = 256; short previousLed = time%4; short currentLed = previousLed; while ((time != 0xFFFFFFFF || duration != 0xFFFFFFFF || waveLenght != 0xFFFFFFFF) && c > 255) { currentLed = time%4 == previousLed ? (time+1) % 4 : time % 4; turnOnLed(currentLed); allTime = time+duration; c = serial_getc_nb(); initMsTimer0(duration); playWaveLenghtMm(waveLenght); launchAndWaitTimer0(); shutUp(); address ++; turnOffLed(currentLed); previousLed = currentLed; time = *address; address ++; duration = *address; address ++; waveLenght = *address; } unsigned int a = 0; asm volatile("bx %0"::"r"(a)); return 0; }