Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156096
b: refs/heads/master
c: 1842f23
h: refs/heads/master
v: v3
  • Loading branch information
Rusty Russell committed Jul 30, 2009
1 parent 6cdc089 commit b2959a2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a91d74a3c4de8115295ee87350c13a329164aaaf
refs/heads/master: 1842f23c05b6a866be831aa60bc8a8731c58ddd0
21 changes: 5 additions & 16 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ static int lguest_fd;
static unsigned int __thread cpu_id;

/* This is our list of devices. */
struct device_list
{
struct device_list {
/* Counter to assign interrupt numbers. */
unsigned int next_irq;

Expand All @@ -114,8 +113,7 @@ struct device_list
static struct device_list devices;

/* The device structure describes a single device. */
struct device
{
struct device {
/* The linked-list pointer. */
struct device *next;

Expand All @@ -140,8 +138,7 @@ struct device
};

/* The virtqueue structure describes a queue attached to a device. */
struct virtqueue
{
struct virtqueue {
struct virtqueue *next;

/* Which device owns me. */
Expand Down Expand Up @@ -779,8 +776,7 @@ static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len)
*
* We associate some data with the console for our exit hack.
*/
struct console_abort
{
struct console_abort {
/* How many times have they hit ^C? */
int count;
/* When did they start? */
Expand Down Expand Up @@ -1570,20 +1566,13 @@ static void setup_tun_net(char *arg)
/*:*/

/* This hangs off device->priv. */
struct vblk_info
{
struct vblk_info {
/* The size of the file. */
off64_t len;

/* The file descriptor for the file. */
int fd;

/* IO thread listens on this file descriptor [0]. */
int workpipe[2];

/* IO thread writes to this file descriptor to mark it done, then
* Launcher triggers interrupt to Guest. */
int done_fd;
};

/*L:210
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/lguest/lg.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@
void free_pagetables(void);
int init_pagetables(struct page **switcher_page, unsigned int pages);

struct pgdir
{
struct pgdir {
unsigned long gpgdir;
pgd_t *pgdir;
};

/* We have two pages shared with guests, per cpu. */
struct lguest_pages
{
struct lguest_pages {
/* This is the stack page mapped rw in guest */
char spare[PAGE_SIZE - sizeof(struct lguest_regs)];
struct lguest_regs regs;
Expand Down Expand Up @@ -89,8 +87,7 @@ struct lg_eventfd_map {
};

/* The private info the thread maintains about the guest. */
struct lguest
{
struct lguest {
struct lguest_data __user *lguest_data;
struct lg_cpu cpus[NR_CPUS];
unsigned int nr_cpus;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/lguest/lguest_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ static void lg_reset(struct virtio_device *vdev)
*/

/*D:140 This is the information we remember about each virtqueue. */
struct lguest_vq_info
{
struct lguest_vq_info {
/* A copy of the information contained in the device config. */
struct lguest_vqconfig config;

Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/lguest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
* lguest_data". Once the Guest's initialization hypercall tells the Host where
* this is, the Guest and Host both publish information in it.
:*/
struct lguest_data
{
struct lguest_data {
/*
* 512 == enabled (same as eflags in normal hardware). The Guest
* changes interrupts so often that a hypercall is too slow.
Expand Down
6 changes: 2 additions & 4 deletions trunk/include/linux/virtio_blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

#define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */

struct virtio_blk_config
{
struct virtio_blk_config {
/* The capacity (in 512-byte sectors). */
__u64 capacity;
/* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
Expand Down Expand Up @@ -50,8 +49,7 @@ struct virtio_blk_config
#define VIRTIO_BLK_T_BARRIER 0x80000000

/* This is the first element of the read scatter-gather list. */
struct virtio_blk_outhdr
{
struct virtio_blk_outhdr {
/* VIRTIO_BLK_T* */
__u32 type;
/* io priority. */
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/linux/virtio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
* the dev->feature bits if it wants.
*/
typedef void vq_callback_t(struct virtqueue *);
struct virtio_config_ops
{
struct virtio_config_ops {
void (*get)(struct virtio_device *vdev, unsigned offset,
void *buf, unsigned len);
void (*set)(struct virtio_device *vdev, unsigned offset,
Expand Down
6 changes: 2 additions & 4 deletions trunk/include/linux/virtio_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@

#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */

struct virtio_net_config
{
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
__u8 mac[6];
/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
Expand All @@ -41,8 +40,7 @@ struct virtio_net_config

/* This is the first element of the scatter-gather list. If you don't
* specify GSO or CSUM features, you can simply ignore the header. */
struct virtio_net_hdr
{
struct virtio_net_hdr {
#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
__u8 flags;
#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
Expand Down
12 changes: 4 additions & 8 deletions trunk/include/linux/virtio_ring.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#define VIRTIO_RING_F_INDIRECT_DESC 28

/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
struct vring_desc
{
struct vring_desc {
/* Address (guest-physical). */
__u64 addr;
/* Length. */
Expand All @@ -42,24 +41,21 @@ struct vring_desc
__u16 next;
};

struct vring_avail
{
struct vring_avail {
__u16 flags;
__u16 idx;
__u16 ring[];
};

/* u32 is used here for ids for padding reasons. */
struct vring_used_elem
{
struct vring_used_elem {
/* Index of start of used descriptor chain. */
__u32 id;
/* Total length of the descriptor chain which was used (written to) */
__u32 len;
};

struct vring_used
{
struct vring_used {
__u16 flags;
__u16 idx;
struct vring_used_elem ring[];
Expand Down

0 comments on commit b2959a2

Please sign in to comment.