|
|
1.1 root 1: /*
2: * Copyright (C) 2006-2009 Free Software Foundation
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 the program ; if not, write to the Free Software
16: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17: */
18:
19: #ifndef XEN_RING_H
20: #define XEN_RING_H
21:
22: typedef unsigned32_t hyp_ring_pos_t;
23:
24: #define hyp_ring_idx(ring, pos) (((unsigned)(pos)) & (sizeof(ring)-1))
25: #define hyp_ring_cell(ring, pos) (ring)[hyp_ring_idx((ring), (pos))]
26: #define hyp_ring_smash(ring, prod, cons) (hyp_ring_idx((ring), (prod) + 1) == \
27: hyp_ring_idx((ring), (cons)))
28: #define hyp_ring_available(ring, prod, cons) hyp_ring_idx((ring), (cons)-(prod)-1)
29:
30: void hyp_ring_store(void *dest, const void *src, size_t size, void *start, void *end);
31: void hyp_ring_fetch(void *dest, const void *src, size_t size, void *start, void *end);
32: size_t hyp_ring_next_word(char **c, void *start, void *end);
33:
34: #endif /* XEN_RING_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.