Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


reformatting include files
[palacios.git] / palacios / include / palacios / vmm_ringbuffer.h
1 /*
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> 
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20 #ifndef __VMM_RING_BUFFER_H__
21 #define __VMM_RING_BUFFER_H__
22
23 #ifdef __V3VEE__
24
25 #include <palacios/vmm_types.h>
26
27 #ifdef INSTRUMENT_VMM
28 #define NO_INST __attribute__((__no_instrument_function__))
29 #else 
30 #define NO_INST 
31 #endif
32
33 struct v3_ringbuf {
34     uchar_t * buf;
35     uint_t size;
36
37     uint_t start;
38     uint_t end;
39     uint_t current_len;
40 };
41
42
43 void v3_init_ringbuf(struct v3_ringbuf * ring, uint_t size) NO_INST;
44 struct v3_ringbuf * v3_create_ringbuf(uint_t size) NO_INST;
45 void v3_free_ringbuf(struct v3_ringbuf * ring) NO_INST;
46
47
48 int v3_ringbuf_read(struct v3_ringbuf * ring, uchar_t * dst, uint_t len) NO_INST;
49 int v3_ringbuf_peek(struct v3_ringbuf * ring, uchar_t * dst, uint_t len) NO_INST;
50 int v3_ringbuf_delete(struct v3_ringbuf * ring, uint_t len) NO_INST;
51 int v3_ringbuf_write(struct v3_ringbuf * ring, uchar_t * src, uint_t len) NO_INST;
52 int v3_ringbuf_data_len(struct v3_ringbuf * ring) NO_INST;
53 int v3_ringbuf_capacity(struct v3_ringbuf * ring) NO_INST;
54 int v3_ringbuf_avail_space(struct v3_ringbuf * ring) NO_INST;
55
56 void v3_print_ringbuf(struct v3_ringbuf * ring) NO_INST;
57
58
59 #endif
60
61 #endif // ! __VMM_RING_BUFFER_H__