if_ring.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:2k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* if_ring.h - network interface ring header file */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02g,22sep92,rrr  added support for c++
  7. 02f,26may92,rrr  the tree shuffle
  8. 02e,04oct91,rrr  passed through the ansification filter
  9.   -fixed #else and #endif
  10.   -changed copyright notice
  11. 02d,10jun91.del  added pragma for gnu960 alignment.
  12. 02c,05oct90,shl  added copyright notice.
  13.                  made #endif ANSI style.
  14. 02b,20sep88,gae  added inclusion ifndef.
  15. 02a,03apr87,ecs  added header and copyright.
  16. */
  17. #ifndef __INCif_ringh
  18. #define __INCif_ringh
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  23. #pragma align 1                 /* tell gcc960 not to optimize alignments */
  24. #endif /* CPU_FAMILY==I960 */
  25. /*
  26.  * The "ring" data structures.
  27.  *  Contains some number of slots, and read & write indexes thereinto.
  28.  *  Also a size field, specifying the number of slots allocated.
  29.  */
  30. struct ring {
  31. short r_rdidx; /* read index */
  32. short r_wrtidx; /* write index */
  33. short r_size; /* number of slots in ring */
  34. char r_tas; /* TAS multi-processor interlock flag */
  35. char r_pad; /* alignment pad */
  36. int r_slot[1]; /* slots -- actually more than 1 */
  37. };
  38. struct ring32 {
  39. short r_rdidx; /* read index */
  40. short r_wrtidx; /* write index */
  41. short r_size; /* number of slots in ring */
  42. char r_tas; /* TAS multi-processor interlock flag */
  43. char r_pad; /* alignment pad */
  44. int r_slot[32]; /* slots */
  45. };
  46. struct ring256 {
  47. short r_rdidx; /* read index */
  48. short r_wrtidx; /* write index */
  49. short r_size; /* number of slots in ring */
  50. char r_tas; /* TAS multi-processor interlock flag */
  51. char r_pad; /* alignment pad */
  52. int r_slot[256]; /* slots */
  53. };
  54. struct bcb {
  55. struct bcb *b_link;
  56. short b_stat;
  57. short b_len;
  58. char *b_addr;
  59. short b_msglen;
  60. short b_reserved;
  61. };
  62. #if ((CPU_FAMILY==I960) && (defined __GNUC__))
  63. #pragma align 0                 /* turn off alignment requirement */
  64. #endif /* CPU_FAMILY==I960 */
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif /* __INCif_ringh */