| static void udelay(int loops) |
| io_delay(); /* Approximately 1 us */ |
| static void beep(unsigned int hz) |
| enable = 0x00; /* Turn off speaker */ |
| outb(0xb6, 0x43); /* Ctr 2, squarewave, load, binary */ |
| outb(div, 0x42); /* LSB of counter */ |
| outb(div >> 8, 0x42); /* MSB of counter */ |
| enable = 0x03; /* Turn on speaker */ |
| inb(0x61); /* Dummy read of System Control Port B */ |
| outb(enable, 0x61); /* Enable timer 2 output to speaker */ |
| #define US_PER_DOT 125000 |
| /* Okay, this is totally silly, but it's kind of fun. */ |
| static void send_morse(const char *pattern) |
| while ((s = *pattern++)) { |
| default: /* Assume it's a space */ |
| /* Kill machine if structures are wrong */ |
| if (wakeup_header.real_magic != 0x12345678) |
| if (wakeup_header.realmode_flags & 4) |
| if (wakeup_header.realmode_flags & 1) |
| asm volatile("lcallw $0xc000,$3"); |
| if (wakeup_header.realmode_flags & 2) { |
| set_mode(wakeup_header.video_mode); |