PageRenderTime 23ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/oskit/x86/pc/debug.h

https://bitbucket.org/mischief/oskit
C Header | 65 lines | 29 code | 17 blank | 19 comment | 1 complexity | cf068a62b579ea96c83d2355e72c7229 MD5 | raw file
Possible License(s): GPL-2.0
  1. /*
  2. * Copyright (c) 1994-1995, 1998 University of Utah and the Flux Group.
  3. * All rights reserved.
  4. *
  5. * This file is part of the Flux OSKit. The OSKit is free software, also known
  6. * as "open source;" you can redistribute it and/or modify it under the terms
  7. * of the GNU General Public License (GPL), version 2, as published by the Free
  8. * Software Foundation (FSF). To explore alternate licensing terms, contact
  9. * the University of Utah at csl-dist@cs.utah.edu or +1-801-585-3271.
  10. *
  11. * The OSKit is distributed in the hope that it will be useful, but WITHOUT ANY
  12. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. * FOR A PARTICULAR PURPOSE. See the GPL for more details. You should have
  14. * received a copy of the GPL along with the OSKit; see the file COPYING. If
  15. * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA.
  16. */
  17. #ifndef _KUKM_I386_PC_DEBUG_H_
  18. #define _KUKM_I386_PC_DEBUG_H_
  19. #ifdef ASSEMBLER
  20. #ifdef DEBUG
  21. /* Poke a character directly onto the VGA text display,
  22. as a very quick, mostly-reliable status indicator.
  23. Assumes ss is a kernel data segment register. */
  24. #define POKE_STATUS(char,scratch) \
  25. ss/*XXX gas bug */ ;\
  26. movl %ss:_phys_mem_va,scratch ;\
  27. addl $0xb8000+80*2*13+40*2,scratch ;\
  28. movb char,%ss:(scratch) ;\
  29. movb $0xf0,%ss:1(scratch)
  30. #else !DEBUG
  31. #define POKE_STATUS(char,scratch)
  32. #endif !DEBUG
  33. #else !ASSEMBLER
  34. #ifdef DEBUG
  35. #include <mach/machine/vm_types.h>
  36. #define POKE_STATUS(string) \
  37. ({ unsigned char *s = (string); \
  38. extern oskit_addr_t phys_mem_va; \
  39. short *d = (short*)(phys_mem_va+0xb8000+80*2*13+40*2); \
  40. while (*s) { (*d++) = 0x3000 | (*s++); } \
  41. *d = ' '; \
  42. })
  43. #else !DEBUG
  44. #define POKE_STATUS(char)
  45. #endif !DEBUG
  46. #endif !ASSEMBLER
  47. #include_next "debug.h"
  48. #endif _KUKM_I386_PC_DEBUG_H_