~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/ubuntu/linaro/0039-fifo8-Add-support-for-reading-number-of-bytes-in-FIF.patch/include/qemu/fifo8.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef FIFO_H
 
2
#define FIFO_H
 
3
 
 
4
#include "migration/vmstate.h"
 
5
 
 
6
typedef struct {
 
7
    /* All fields are private */
 
8
    uint8_t *data;
 
9
    uint32_t capacity;
 
10
    uint32_t head;
 
11
    uint32_t num;
 
12
} Fifo8;
 
13
 
 
14
/**
 
15
 * fifo8_create:
 
16
 * @fifo: struct Fifo8 to initialise with new FIFO
 
17
 * @capacity: capacity of the newly created FIFO
 
18
 *
 
19
 * Create a FIFO of the specified size. Clients should call fifo8_destroy()
 
20
 * when finished using the fifo. The FIFO is initially empty.
 
21
 */
 
22
 
 
23
void fifo8_create(Fifo8 *fifo, uint32_t capacity);
 
24
 
 
25
/**
 
26
 * fifo8_destroy:
 
27
 * @fifo: FIFO to cleanup
 
28
 *
 
29
 * Cleanup a FIFO created with fifo8_create(). Frees memory created for FIFO
 
30
  *storage. The FIFO is no longer usable after this has been called.
 
31
 */
 
32
 
 
33
void fifo8_destroy(Fifo8 *fifo);
 
34
 
 
35
/**
 
36
 * fifo8_push:
 
37
 * @fifo: FIFO to push to
 
38
 * @data: data byte to push
 
39
 *
 
40
 * Push a data byte to the FIFO. Behaviour is undefined if the FIFO is full.
 
41
 * Clients are responsible for checking for fullness using fifo8_is_full().
 
42
 */
 
43
 
 
44
void fifo8_push(Fifo8 *fifo, uint8_t data);
 
45
 
 
46
/**
 
47
 * fifo8_pop:
 
48
 * @fifo: fifo to pop from
 
49
 *
 
50
 * Pop a data byte from the FIFO. Behaviour is undefined if the FIFO is empty.
 
51
 * Clients are responsible for checking for emptyness using fifo8_is_empty().
 
52
 *
 
53
 * Returns: The popped data byte.
 
54
 */
 
55
 
 
56
uint8_t fifo8_pop(Fifo8 *fifo);
 
57
 
 
58
/**
 
59
 * fifo8_reset:
 
60
 * @fifo: FIFO to reset
 
61
 *
 
62
 * Reset a FIFO. All data is discarded and the FIFO is emptied.
 
63
 */
 
64
 
 
65
void fifo8_reset(Fifo8 *fifo);
 
66
 
 
67
/**
 
68
 * fifo8_is_empty:
 
69
 * @fifo: FIFO to check
 
70
 *
 
71
 * Check if a FIFO is empty.
 
72
 *
 
73
 * Returns: True if the fifo is empty, false otherwise.
 
74
 */
 
75
 
 
76
bool fifo8_is_empty(Fifo8 *fifo);
 
77
 
 
78
/**
 
79
 * fifo8_is_full:
 
80
 * @fifo: FIFO to check
 
81
 *
 
82
 * Check if a FIFO is full.
 
83
 *
 
84
 * Returns: True if the fifo is full, false otherwise.
 
85
 */
 
86
 
 
87
bool fifo8_is_full(Fifo8 *fifo);
 
88
 
 
89
extern const VMStateDescription vmstate_fifo8;
 
90
 
 
91
#define VMSTATE_FIFO8(_field, _state) {                              \
 
92
    .name       = (stringify(_field)),                               \
 
93
    .size       = sizeof(Fifo8),                                     \
 
94
    .vmsd       = &vmstate_fifo8,                                    \
 
95
    .flags      = VMS_STRUCT,                                        \
 
96
    .offset     = vmstate_offset_value(_state, _field, Fifo8),       \
 
97
}
 
98
 
 
99
#endif /* FIFO_H */