it_lp_queue.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2001 Mike Corrigan IBM Corporation
  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 this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. #ifndef _ASM_POWERPC_ISERIES_IT_LP_QUEUE_H
  19. #define _ASM_POWERPC_ISERIES_IT_LP_QUEUE_H
  20. /*
  21. * This control block defines the simple LP queue structure that is
  22. * shared between the hypervisor (PLIC) and the OS in order to send
  23. * events to an LP.
  24. */
  25. #include <asm/types.h>
  26. #include <asm/ptrace.h>
  27. struct HvLpEvent;
  28. #define IT_LP_MAX_QUEUES 8
  29. #define IT_LP_NOT_USED 0 /* Queue will not be used by PLIC */
  30. #define IT_LP_DEDICATED_IO 1 /* Queue dedicated to IO processor specified */
  31. #define IT_LP_DEDICATED_LP 2 /* Queue dedicated to LP specified */
  32. #define IT_LP_SHARED 3 /* Queue shared for both IO and LP */
  33. #define IT_LP_EVENT_STACK_SIZE 4096
  34. #define IT_LP_EVENT_MAX_SIZE 256
  35. #define IT_LP_EVENT_ALIGN 64
  36. struct hvlpevent_queue {
  37. /*
  38. * The hq_current_event is the pointer to the next event stack entry
  39. * that will become valid. The OS must peek at this entry to determine
  40. * if it is valid. PLIC will set the valid indicator as the very last
  41. * store into that entry.
  42. *
  43. * When the OS has completed processing of the event then it will mark
  44. * the event as invalid so that PLIC knows it can store into that event
  45. * location again.
  46. *
  47. * If the event stack fills and there are overflow events, then PLIC
  48. * will set the hq_overflow_pending flag in which case the OS will
  49. * have to fetch the additional LP events once they have drained the
  50. * event stack.
  51. *
  52. * The first 16-bytes are known by both the OS and PLIC. The remainder
  53. * of the cache line is for use by the OS.
  54. */
  55. u8 hq_overflow_pending; /* 0x00 Overflow events are pending */
  56. u8 hq_status; /* 0x01 DedicatedIo or DedicatedLp or NotUsed */
  57. u16 hq_proc_index; /* 0x02 Logical Proc Index for correlation */
  58. u8 hq_reserved1[12]; /* 0x04 */
  59. char *hq_current_event; /* 0x10 */
  60. char *hq_last_event; /* 0x18 */
  61. char *hq_event_stack; /* 0x20 */
  62. u8 hq_index; /* 0x28 unique sequential index. */
  63. u8 hq_reserved2[3]; /* 0x29-2b */
  64. spinlock_t hq_lock;
  65. };
  66. extern struct hvlpevent_queue hvlpevent_queue;
  67. extern int hvlpevent_is_pending(void);
  68. extern void process_hvlpevents(struct pt_regs *);
  69. extern void setup_hvlpevent_queue(void);
  70. #endif /* _ASM_POWERPC_ISERIES_IT_LP_QUEUE_H */