/sys/mips/include/cpu.h

https://bitbucket.org/iorivur/freebsd-bhyve-with-suspend-resume · C Header · 89 lines · 23 code · 14 blank · 52 comment · 2 complexity · 025c0f5c31370a11828897561cb50cf0 MD5 · raw file

  1. /* $OpenBSD: cpu.h,v 1.4 1998/09/15 10:50:12 pefo Exp $ */
  2. /*-
  3. * Copyright (c) 1992, 1993
  4. * The Regents of the University of California. All rights reserved.
  5. *
  6. * This code is derived from software contributed to Berkeley by
  7. * Ralph Campbell and Rick Macklem.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 4. Neither the name of the University nor the names of its contributors
  18. * may be used to endorse or promote products derived from this software
  19. * without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. * SUCH DAMAGE.
  32. *
  33. * Copyright (C) 1989 Digital Equipment Corporation.
  34. * Permission to use, copy, modify, and distribute this software and
  35. * its documentation for any purpose and without fee is hereby granted,
  36. * provided that the above copyright notice appears in all copies.
  37. * Digital Equipment Corporation makes no representations about the
  38. * suitability of this software for any purpose. It is provided "as is"
  39. * without express or implied warranty.
  40. *
  41. * from: @(#)cpu.h 8.4 (Berkeley) 1/4/94
  42. * JNPR: cpu.h,v 1.9.2.2 2007/09/10 08:23:46 girish
  43. * $FreeBSD: head/sys/mips/include/cpu.h 232630 2012-03-06 23:08:02Z jmallett $
  44. */
  45. #ifndef _MACHINE_CPU_H_
  46. #define _MACHINE_CPU_H_
  47. #include <machine/endian.h>
  48. /* BEGIN: these are going away */
  49. #define soft_int_mask(softintr) (1 << ((softintr) + 8))
  50. #define hard_int_mask(hardintr) (1 << ((hardintr) + 10))
  51. /* END: These are going away */
  52. /*
  53. * Exported definitions unique to mips cpu support.
  54. */
  55. #ifndef _LOCORE
  56. #include <machine/cpufunc.h>
  57. #include <machine/frame.h>
  58. #define TRAPF_USERMODE(framep) (((framep)->sr & MIPS_SR_KSU_USER) != 0)
  59. #define TRAPF_PC(framep) ((framep)->pc)
  60. #define cpu_getstack(td) ((td)->td_frame->sp)
  61. #define cpu_setstack(td, nsp) ((td)->td_frame->sp = (nsp))
  62. #define cpu_spinwait() /* nothing */
  63. /*
  64. * A machine-independent interface to the CPU's counter.
  65. */
  66. #define get_cyclecount() mips_rd_count()
  67. #endif /* !_LOCORE */
  68. #if defined(_KERNEL) && !defined(_LOCORE)
  69. extern char btext[];
  70. extern char etext[];
  71. void swi_vm(void *);
  72. void cpu_halt(void);
  73. void cpu_reset(void);
  74. #endif /* _KERNEL */
  75. #endif /* !_MACHINE_CPU_H_ */