ItLpQueue.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * ItLpQueue.h
  3. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef _ITLPQUEUE_H
  20. #define _ITLPQUEUE_H
  21. /*
  22. * This control block defines the simple LP queue structure that is
  23. * shared between the hypervisor (PLIC) and the OS in order to send
  24. * events to an LP.
  25. */
  26. #include <asm/types.h>
  27. #include <asm/ptrace.h>
  28. struct HvLpEvent;
  29. #define ITMaxLpQueues 8
  30. #define NotUsed 0 // Queue will not be used by PLIC
  31. #define DedicatedIo 1 // Queue dedicated to IO processor specified
  32. #define DedicatedLp 2 // Queue dedicated to LP specified
  33. #define Shared 3 // Queue shared for both IO and LP
  34. #define LpEventStackSize 4096
  35. #define LpEventMaxSize 256
  36. #define LpEventAlign 64
  37. struct hvlpevent_queue {
  38. /*
  39. * The xSlicCurEventPtr is the pointer to the next event stack entry
  40. * that will become valid. The OS must peek at this entry to determine
  41. * if it is valid. PLIC will set the valid indicator as the very last
  42. * store into that entry.
  43. *
  44. * When the OS has completed processing of the event then it will mark
  45. * the event as invalid so that PLIC knows it can store into that event
  46. * location again.
  47. *
  48. * If the event stack fills and there are overflow events, then PLIC
  49. * will set the xPlicOverflowIntPending flag in which case the OS will
  50. * have to fetch the additional LP events once they have drained the
  51. * event stack.
  52. *
  53. * The first 16-bytes are known by both the OS and PLIC. The remainder
  54. * of the cache line is for use by the OS.
  55. */
  56. u8 xPlicOverflowIntPending;// 0x00 Overflow events are pending
  57. u8 xPlicStatus; // 0x01 DedicatedIo or DedicatedLp or NotUsed
  58. u16 xSlicLogicalProcIndex; // 0x02 Logical Proc Index for correlation
  59. u8 xPlicRsvd[12]; // 0x04
  60. char *xSlicCurEventPtr; // 0x10
  61. char *xSlicLastValidEventPtr; // 0x18
  62. char *xSlicEventStackPtr; // 0x20
  63. u8 xIndex; // 0x28 unique sequential index.
  64. u8 xSlicRsvd[3]; // 0x29-2b
  65. spinlock_t lock;
  66. };
  67. extern struct hvlpevent_queue hvlpevent_queue;
  68. extern int hvlpevent_is_pending(void);
  69. extern void process_hvlpevents(struct pt_regs *);
  70. extern void setup_hvlpevent_queue(void);
  71. #endif /* _ITLPQUEUE_H */