summaryrefslogtreecommitdiff
path: root/xen
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2016-03-30 02:26:28 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-04 09:36:36 +0200
commit7bbfa39f59dcbc55b21d31abb9e2febef6a51ebb (patch)
tree840a881ede29701996d51a94272b4da3115e3412 /xen
parenta90dc34f976cd37da23af526120f2ac480cb131f (diff)
Use uint32_t instead of unsigned32_t.
Implement stdint.h and use it in gnumach. Remove old type definitions such as signed* and unsigned*. * Makefile.am: Add -ffreestanding. * i386/i386/xen.h: Use uint64_t. * i386/include/mach/i386/machine_types.defs: Use uint32_t and int32_t. * i386/include/mach/i386/vm_types.h: Remove definitions of int*, uint*, unsigned* and signed* types. * i386/xen/xen.c: Use uint64_t. * include/device/device_types.defs: Use uint32_t. * include/mach/std_types.defs: Use POSIX types. * include/mach/std_types.h: Include stdint.h. * include/stdint.h: New file with POSIX types. * include/sys/types.h: Include stdint.h. * ipc/ipc_kmsg.c: Use uint64_t. * kern/exception.c: Use uint32_t. * linux/dev/include/linux/types.h: Remove POSIX types. * xen/block.c: Use uint64_t. * xen/net.c: Do not use removed unsigned*_t types. * xen/ring.h: Use uint32_t instead. * xen/store.c: Use uint32_t. * xen/store.h: Use uint32_t. * xen/time.c: Use POSIX types only. * xen/time.h: Use uint64_t.
Diffstat (limited to 'xen')
-rw-r--r--xen/block.c4
-rw-r--r--xen/net.c6
-rw-r--r--xen/public/elfstructs.h2
-rw-r--r--xen/ring.h2
-rw-r--r--xen/store.c4
-rw-r--r--xen/store.h2
-rw-r--r--xen/time.c28
-rw-r--r--xen/time.h2
8 files changed, 25 insertions, 25 deletions
diff --git a/xen/block.c b/xen/block.c
index d98b31e2..46df3589 100644
--- a/xen/block.c
+++ b/xen/block.c
@@ -489,7 +489,7 @@ device_read (void *d, ipc_port_t reply_port,
req->operation = BLKIF_OP_READ;
req->nr_segments = nbpages;
req->handle = bd->handle;
- req->id = (unsigned64_t) (unsigned long) &err; /* pointer on the stack */
+ req->id = (uint64_t) (unsigned long) &err; /* pointer on the stack */
req->sector_number = bn + offset / 512;
for (i = 0; i < nbpages; i++) {
req->seg[i].gref = gref[i] = hyp_grant_give(bd->domid, atop(pages[i]->phys_addr), 0);
@@ -641,7 +641,7 @@ device_write(void *d, ipc_port_t reply_port,
req->operation = BLKIF_OP_WRITE;
req->nr_segments = nbpages;
req->handle = bd->handle;
- req->id = (unsigned64_t) (unsigned long) &err; /* pointer on the stack */
+ req->id = (uint64_t) (unsigned long) &err; /* pointer on the stack */
req->sector_number = bn + i*PAGE_SIZE / 512;
for (j = 0; j < nbpages; j++) {
diff --git a/xen/net.c b/xen/net.c
index 55643651..a5db4568 100644
--- a/xen/net.c
+++ b/xen/net.c
@@ -119,10 +119,10 @@ static void enqueue_rx_buf(struct net_data *nd, int number) {
}
static int recompute_checksum(void *data, int len) {
- unsigned16_t *header16 = data;
- unsigned8_t *header8 = data;
+ uint16_t *header16 = data;
+ uint8_t *header8 = data;
unsigned length, i;
- unsigned32_t checksum = 0;
+ uint32_t checksum = 0;
/* IPv4 header length */
length = (header8[0] & 0xf) * 4;
diff --git a/xen/public/elfstructs.h b/xen/public/elfstructs.h
index 77362f3b..65d53457 100644
--- a/xen/public/elfstructs.h
+++ b/xen/public/elfstructs.h
@@ -353,7 +353,7 @@ typedef struct {
#define ELF64_R_SYM(info) ((info) >> 32)
#define ELF64_R_TYPE(info) ((info) & 0xFFFFFFFF)
-#define ELF64_R_INFO(s,t) (((s) << 32) + (u_int32_t)(t))
+#define ELF64_R_INFO(s,t) (((s) << 32) + (uint32_t)(t))
/* Program Header */
typedef struct {
diff --git a/xen/ring.h b/xen/ring.h
index c5c2fe39..1ac8b37d 100644
--- a/xen/ring.h
+++ b/xen/ring.h
@@ -19,7 +19,7 @@
#ifndef XEN_RING_H
#define XEN_RING_H
-typedef unsigned32_t hyp_ring_pos_t;
+typedef uint32_t hyp_ring_pos_t;
#define hyp_ring_idx(ring, pos) (((unsigned)(pos)) & (sizeof(ring)-1))
#define hyp_ring_cell(ring, pos) (ring)[hyp_ring_idx((ring), (pos))]
diff --git a/xen/store.c b/xen/store.c
index 739dc367..659a70c7 100644
--- a/xen/store.c
+++ b/xen/store.c
@@ -46,7 +46,7 @@ struct store_req {
};
/* Send a request */
-static void store_put(hyp_store_transaction_t t, unsigned32_t type, struct store_req *req, unsigned nr_reqs) {
+static void store_put(hyp_store_transaction_t t, uint32_t type, struct store_req *req, unsigned nr_reqs) {
struct xsd_sockmsg head = {
.type = type,
.req_id = 0,
@@ -105,7 +105,7 @@ static const char *errors[] = {
static struct xsd_sockmsg head;
const char *hyp_store_error;
-static void *store_put_wait(hyp_store_transaction_t t, unsigned32_t type, struct store_req *req, unsigned nr_reqs) {
+static void *store_put_wait(hyp_store_transaction_t t, uint32_t type, struct store_req *req, unsigned nr_reqs) {
unsigned len;
const char **error;
void *data;
diff --git a/xen/store.h b/xen/store.h
index ae236eb6..6bb78ea1 100644
--- a/xen/store.h
+++ b/xen/store.h
@@ -21,7 +21,7 @@
#include <machine/xen.h>
#include <xen/public/io/xenbus.h>
-typedef unsigned32_t hyp_store_transaction_t;
+typedef uint32_t hyp_store_transaction_t;
#define hyp_store_state_unknown "0"
#define hyp_store_state_initializing "1"
diff --git a/xen/time.c b/xen/time.c
index 4ebe91fa..3ad73e23 100644
--- a/xen/time.c
+++ b/xen/time.c
@@ -28,14 +28,14 @@
#include "time.h"
#include "store.h"
-static unsigned64_t lastnsec;
+static uint64_t lastnsec;
/* 2^64 nanoseconds ~= 500 years */
-static unsigned64_t hyp_get_stime(void) {
- unsigned32_t version;
- unsigned64_t cpu_clock, last_cpu_clock, delta, system_time;
- unsigned64_t delta_high, delta_low;
- unsigned32_t mul;
+static uint64_t hyp_get_stime(void) {
+ uint32_t version;
+ uint64_t cpu_clock, last_cpu_clock, delta, system_time;
+ uint64_t delta_high, delta_low;
+ uint32_t mul;
signed8_t shift;
volatile struct vcpu_time_info *time = &hyp_shared_info.vcpu_info[0].time;
@@ -56,14 +56,14 @@ static unsigned64_t hyp_get_stime(void) {
else
delta <<= shift;
delta_high = delta >> 32;
- delta_low = (unsigned32_t) delta;
- return system_time + ((delta_low * (unsigned64_t) mul) >> 32)
- + (delta_high * (unsigned64_t) mul);
+ delta_low = (uint32_t) delta;
+ return system_time + ((delta_low * (uint64_t) mul) >> 32)
+ + (delta_high * (uint64_t) mul);
}
-unsigned64_t hyp_get_time(void) {
- unsigned32_t version;
- unsigned32_t sec, nsec;
+uint64_t hyp_get_time(void) {
+ uint32_t version;
+ uint32_t sec, nsec;
do {
version = hyp_shared_info.wc_version;
@@ -77,7 +77,7 @@ unsigned64_t hyp_get_time(void) {
}
static void hypclock_intr(int unit, int old_ipl, void *ret_addr, struct i386_interrupt_state *regs) {
- unsigned64_t nsec, delta;
+ uint64_t nsec, delta;
if (!lastnsec)
return;
@@ -116,7 +116,7 @@ int
readtodc(tp)
u_int *tp;
{
- unsigned64_t t = hyp_get_time();
+ uint64_t t = hyp_get_time();
u_int n = t / 1000000000;
*tp = n;
diff --git a/xen/time.h b/xen/time.h
index 8c8bc53e..cf28720f 100644
--- a/xen/time.h
+++ b/xen/time.h
@@ -20,6 +20,6 @@
#define XEN_TIME_H
#include <mach/mach_types.h>
-unsigned64_t hyp_get_time(void);
+uint64_t hyp_get_time(void);
#endif /* XEN_TIME_H */