1 $NetBSD: patch-ab,v 1.3 2008/11/24 04:06:00 smb Exp $
3 --- test.c.orig 2009-09-22 00:35:46.000000000 +0000
14 +pkg_outb (unsigned char value, unsigned short int port)
16 + __asm__ __volatile__ ("outb %b0,%w1": :"a" (value), "Nd" (port));
20 +pkg_outb_p (unsigned char value, unsigned short int port)
22 + __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80": :"a" (value),
26 +static __inline unsigned char
27 +pkg_inb_p (unsigned short int port)
31 + __asm__ __volatile__ ("inb %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
36 extern int segs, bail;
37 extern volatile ulong *p;
39 @@ -1414,18 +1436,18 @@ void beep(unsigned int frequency)
40 unsigned int count = 1193180 / frequency;
42 // Switch on the speaker
43 - outb_p(inb_p(0x61)|3, 0x61);
44 + pkg_outb_p(pkg_inb_p(0x61)|3, 0x61);
46 // Set command for counter 2, 2 byte write
48 + pkg_outb_p(0xB6, 0x43);
51 - outb_p(count & 0xff, 0x42);
52 - outb((count >> 8) & 0xff, 0x42);
53 + pkg_outb_p(count & 0xff, 0x42);
54 + pkg_outb((count >> 8) & 0xff, 0x42);
56 // Block for 100 microseconds
59 // Switch off the speaker
60 - outb(inb_p(0x61)&0xFC, 0x61);
61 + pkg_outb(pkg_inb_p(0x61)&0xFC, 0x61);