Guest User

NetBSD FreeIPMI Partial Patch

a guest
Aug 13th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.04 KB | None | 0 0
  1. --- libfreeipmi/src/driver/ipmi-kcs-driver.c    2011-04-21 16:02:41.000000000 -0500
  2. +++ libfreeipmi/src/driver/ipmi-kcs-driver.c.netbsd     2011-08-13 22:08:46.000000000 -0500
  3. @@ -158,7 +158,21 @@
  4.  # include <asm/io.h>
  5.  #endif
  6.  
  7. -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
  8. +/* Code for asm_inb() and asm_outb() taken from:
  9. +       http://cvsweb.se.netbsd.org/cgi-bin/bsdweb.cgi/pkgsrc/sysutils/vbetool/patches/patch-ab?rev=1.4;content-type=text/plain
  10. +*/
  11. +#if defined(__NetBSD__)
  12. +static uint8_t asm_inb(unsigned port) {
  13. +       uint8_t data;
  14. +       __asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
  15. +       return data;
  16. +}
  17. +static __inline void asm_outb(uint8_t data, unsigned port) {
  18. +       __asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
  19. +}
  20. +# define _INB(port)  asm_inb (port)
  21. +# define _OUTB(data, port)  asm_outb (data, port)
  22. +#elif defined(__FreeBSD__) || defined(__OpenBSD__)
  23.  # define _INB(port)  inb (port)
  24.  # define _OUTB(data, port)  outb (port, data)
  25.  #elif defined(HAVE_IOPL)
Add Comment
Please, Sign In to add comment