summaryrefslogtreecommitdiffstats
path: root/target-ia64
diff options
context:
space:
mode:
authorJes Sorensen <[email protected]>2008-09-26 16:55:39 +0200
committerAvi Kivity <[email protected]>2008-09-27 13:54:37 +0300
commitdbad8465132d26c2fcb374da239672ee03da2d33 (patch)
treea108b2132e3d97536b8710947fbaf97727118bd1 /target-ia64
parent0423d72165cdf8ae98132621429bc1bb911f3a55 (diff)
downloadqemu-kvm-dbad8465132d26c2fcb374da239672ee03da2d33.tar.gz
qemu-kvm-dbad8465132d26c2fcb374da239672ee03da2d33.tar.bz2
qemu-kvm-dbad8465132d26c2fcb374da239672ee03da2d33.zip
Reindent ia64 code to match qemu code stylekvm-76rc1
Reindent a bunch of ia64 code to better match the QEMU coding style. Signed-off-by: Jes Sorensen <[email protected]> Signed-off-by : Xiantao Zhang <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
Diffstat (limited to 'target-ia64')
-rw-r--r--target-ia64/cpu.h2
-rw-r--r--target-ia64/firmware.c39
-rw-r--r--target-ia64/firmware.h8
-rw-r--r--target-ia64/op_helper.c26
4 files changed, 30 insertions, 45 deletions
diff --git a/target-ia64/cpu.h b/target-ia64/cpu.h
index 28902e0fc..fd00bbb14 100644
--- a/target-ia64/cpu.h
+++ b/target-ia64/cpu.h
@@ -62,7 +62,7 @@ CPUState *cpu_ia64_init(const char * cpu_model);
static inline int cpu_mmu_index (CPUState *env)
{
- return 0;
+ return 0;
}
#define CPU_PC_FROM_TB(env, tb) do{}while(0)
diff --git a/target-ia64/firmware.c b/target-ia64/firmware.c
index b8259e051..c5e4fa9c5 100644
--- a/target-ia64/firmware.c
+++ b/target-ia64/firmware.c
@@ -91,7 +91,7 @@ static int load_hob(void *hob_buf,
int
kvm_ia64_build_hob(unsigned long memsize,
- unsigned long vcpus, uint8_t* fw_start)
+ unsigned long vcpus, uint8_t* fw_start)
{
char *hob_buf;
@@ -112,8 +112,8 @@ kvm_ia64_build_hob(unsigned long memsize,
return -1;
}
free(hob_buf);
- return 0;
+ return 0;
}
static int
@@ -223,7 +223,7 @@ build_hob(void* hob_buf, unsigned long hob_buf_size,
goto err_out;
}
- if (add_pal_hob( hob_buf ) < 0) {
+ if (add_pal_hob(hob_buf) < 0) {
Hob_Output("Add PAL hob failed, buffer too small");
goto err_out;
}
@@ -238,8 +238,7 @@ err_out:
return -1;
}
static int
-load_hob(void *hob_buf,
- unsigned long dom_mem_size, void* hob_start)
+load_hob(void *hob_buf, unsigned long dom_mem_size, void* hob_start)
{
int hob_size;
@@ -508,6 +507,7 @@ add_pal_hob(void* hob_buf)
}
return 0;
}
+
char *read_image(const char *filename, unsigned long *size)
{
int kernel_fd = -1;
@@ -515,18 +515,16 @@ char *read_image(const char *filename, unsigned long *size)
char *image = NULL, *tmp;
unsigned int bytes;
- if ( (filename == NULL) || (size == NULL) )
+ if ((filename == NULL) || (size == NULL))
return NULL;
kernel_fd = open(filename, O_RDONLY);
- if (kernel_fd < 0)
- {
+ if (kernel_fd < 0) {
Hob_Output("Could not open kernel image\n");
goto out_1;
}
- if ( (kernel_gfd = gzdopen(kernel_fd, "rb")) == NULL )
- {
+ if ((kernel_gfd = gzdopen(kernel_fd, "rb")) == NULL) {
Hob_Output("Could not allocate decompression state for state file\n");
goto out_1;
}
@@ -536,8 +534,7 @@ char *read_image(const char *filename, unsigned long *size)
#define CHUNK 1*1024*1024
while(1)
{
- if ( (tmp = realloc(image, *size + CHUNK)) == NULL )
- {
+ if ((tmp = realloc(image, *size + CHUNK)) == NULL) {
Hob_Output("Could not allocate memory for kernel image");
free(image);
image = NULL;
@@ -546,8 +543,7 @@ char *read_image(const char *filename, unsigned long *size)
image = tmp;
bytes = gzread(kernel_gfd, image + *size, CHUNK);
- switch (bytes)
- {
+ switch (bytes) {
case -1:
Hob_Output("Error reading kernel image");
free(image);
@@ -562,24 +558,21 @@ char *read_image(const char *filename, unsigned long *size)
}
#undef CHUNK
- out:
- if ( *size == 0 )
- {
+out:
+ if (*size == 0) {
Hob_Output("Could not read kernel image");
free(image);
image = NULL;
- }
- else if ( image )
- {
+ } else if (image) {
/* Shrink allocation to fit image. */
tmp = realloc(image, *size);
- if ( tmp )
+ if (tmp)
image = tmp;
}
- if ( kernel_gfd != NULL )
+ if (kernel_gfd != NULL)
gzclose(kernel_gfd);
- else if ( kernel_fd >= 0 )
+ else if (kernel_fd >= 0)
close(kernel_fd);
return image;
diff --git a/target-ia64/firmware.h b/target-ia64/firmware.h
index dde8b2dd9..553a9f9fb 100644
--- a/target-ia64/firmware.h
+++ b/target-ia64/firmware.h
@@ -28,19 +28,17 @@
#include <zlib.h>
#define GFW_SIZE (16UL<<20)
-#define GFW_START ((4UL<<30) - GFW_SIZE)
+#define GFW_START ((4UL<<30) - GFW_SIZE)
#define HOB_SIGNATURE 0x3436474953424f48 // "HOBSIG64"
#define GFW_HOB_START ((4UL<<30) - (14UL<<20)) // 4G - 14M
#define GFW_HOB_SIZE (1UL<<20) // 1M
#define HOB_OFFSET (GFW_HOB_START-GFW_START)
-#define Hob_Output(s) \
- fprintf(stderr, s)
+#define Hob_Output(s) fprintf(stderr, s)
extern int kvm_ia64_build_hob(unsigned long memsize,
- unsigned long vcpus, uint8_t* fw_start);
+ unsigned long vcpus, uint8_t* fw_start);
extern char *read_image(const char *filename, unsigned long *size);
#endif //__FIRM_WARE_
-
diff --git a/target-ia64/op_helper.c b/target-ia64/op_helper.c
index 74d30f9ef..b5897f706 100644
--- a/target-ia64/op_helper.c
+++ b/target-ia64/op_helper.c
@@ -27,7 +27,8 @@
#include "qemu-kvm.h"
#include "qemu-common.h"
-CPUState *cpu_ia64_init(const char *cpu_model){
+CPUState *cpu_ia64_init(const char *cpu_model)
+{
CPUState *env;
env = qemu_mallocz(sizeof(CPUState));
if (!env)
@@ -35,8 +36,8 @@ CPUState *cpu_ia64_init(const char *cpu_model){
cpu_exec_init(env);
cpu_reset(env);
if (kvm_enabled()) {
- kvm_qemu_init_env(env);
- kvm_init_new_ap(env->cpu_index, env);
+ kvm_qemu_init_env(env);
+ kvm_init_new_ap(env->cpu_index, env);
}
return env;
}
@@ -45,10 +46,8 @@ void cpu_reset(CPUIA64State *env)
{
}
-
static inline void set_feature(CPUIA64State *env, int feature)
{
-
}
void cpu_ia64_set_model(CPUIA64State *env, uint32_t id)
@@ -60,10 +59,8 @@ void cpu_ia64_close(CPUIA64State *env)
free(env);
}
-
extern int semihosting_enabled;
-
void switch_mode(CPUState *env, int mode)
{
}
@@ -72,15 +69,13 @@ void switch_mode(CPUState *env, int mode)
void do_interrupt(CPUIA64State *env)
{
if (kvm_enabled()) {
- printf("%s: unexpect\n", __FUNCTION__);
- exit(-1);
+ printf("%s: unexpect\n", __FUNCTION__);
+ exit(-1);
}
}
-
-
int cpu_ia64_handle_mmu_fault (CPUState *env, target_ulong address,
- int access_type, int is_user, int is_softmmu)
+ int access_type, int is_user, int is_softmmu)
{
return 1;
}
@@ -90,15 +85,14 @@ target_ulong cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
return -1;
}
-
void cpu_dump_state(CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
int flags)
{
- return;
+ return;
}
+
void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr)
{
- return ;
+ return;
}
-