console.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2006-2009, 2011 Free Software Foundation
  3. *
  4. * This program is free software ; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation ; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY ; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with the program ; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef XEN_CONSOLE_H
  19. #define XEN_CONSOLE_H
  20. #include <machine/xen.h>
  21. #include <string.h>
  22. #include <mach/port.h>
  23. #include <device/cons.h>
  24. #include <device/io_req.h>
  25. #define hyp_console_write(str, len) hyp_console_io (CONSOLEIO_write, (len), kvtolin(str))
  26. #define hyp_console_put(str) ({ \
  27. const char *__str = (void*) (str); \
  28. hyp_console_write (__str, strlen (__str)); \
  29. })
  30. extern void hyp_console_init(void);
  31. extern int hypcnputc(dev_t dev, int c);
  32. extern int hypcngetc(dev_t dev, int wait);
  33. extern int hypcnprobe(struct consdev *cp);
  34. extern int hypcninit(struct consdev *cp);
  35. extern int hypcnopen(dev_t dev, int flag, io_req_t ior);
  36. extern int hypcnread(dev_t dev, io_req_t ior);
  37. extern int hypcnwrite(dev_t dev, io_req_t ior);
  38. extern void hypcnclose(dev_t dev, int flag);
  39. extern io_return_t hypcngetstat(dev_t dev, int flavor, int *data, unsigned int *count);
  40. extern io_return_t hypcnsetstat(dev_t dev, int flavor, int *data, unsigned int count);
  41. extern int hypcnportdeath(dev_t dev, mach_port_t port);
  42. #endif /* XEN_CONSOLE_H */