4 static void udelay(int loops
)
7 io_delay(); /* Approximately 1 us */
10 static void beep(unsigned int hz
)
15 enable
= 0x00; /* Turn off speaker */
19 outb(0xb6, 0x43); /* Ctr 2, squarewave, load, binary */
21 outb(div
, 0x42); /* LSB of counter */
23 outb(div
>> 8, 0x42); /* MSB of counter */
26 enable
= 0x03; /* Turn on speaker */
28 inb(0x61); /* Dummy read of System Control Port B */
30 outb(enable
, 0x61); /* Enable timer 2 output to speaker */
36 #define US_PER_DOT 125000
38 /* Okay, this is totally silly, but it's kind of fun. */
39 static void send_morse(const char *pattern
)
43 while ((s
= *pattern
++)) {
53 udelay(US_PER_DOT
* 3);
57 default: /* Assume it's a space */
58 udelay(US_PER_DOT
* 3);
66 /* Kill machine if structures are wrong */
67 if (wakeup_header
.real_magic
!= 0x12345678)
71 if (wakeup_header
.realmode_flags
& 4)
74 if (wakeup_header
.realmode_flags
& 1)
75 asm volatile("lcallw $0xc000,$3");
77 if (wakeup_header
.realmode_flags
& 2) {
78 /* Need to call BIOS */
80 set_mode(wakeup_header
.video_mode
);