rtlx.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
  3. *
  4. */
  5. #ifndef _RTLX_H
  6. #define _RTLX_H_
  7. #define LX_NODE_BASE 10
  8. #define MIPSCPU_INT_BASE 16
  9. #define MIPS_CPU_RTLX_IRQ 0
  10. #define RTLX_VERSION 1
  11. #define RTLX_xID 0x12345600
  12. #define RTLX_ID (RTLX_xID | RTLX_VERSION)
  13. #define RTLX_CHANNELS 8
  14. enum rtlx_state {
  15. RTLX_STATE_UNUSED = 0,
  16. RTLX_STATE_INITIALISED,
  17. RTLX_STATE_REMOTE_READY,
  18. RTLX_STATE_OPENED
  19. };
  20. #define RTLX_BUFFER_SIZE 1024
  21. /* each channel supports read and write.
  22. linux (vpe0) reads lx_buffer and writes rt_buffer
  23. SP (vpe1) reads rt_buffer and writes lx_buffer
  24. */
  25. typedef struct rtlx_channel {
  26. enum rtlx_state rt_state;
  27. enum rtlx_state lx_state;
  28. int buffer_size;
  29. /* read and write indexes per buffer */
  30. int rt_write, rt_read;
  31. char *rt_buffer;
  32. int lx_write, lx_read;
  33. char *lx_buffer;
  34. void *queues;
  35. } rtlx_channel_t;
  36. typedef struct rtlx_info {
  37. unsigned long id;
  38. enum rtlx_state state;
  39. struct rtlx_channel channel[RTLX_CHANNELS];
  40. } rtlx_info_t;
  41. #endif