Remove tabs, tweak whitespace and comments.
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
#include "s390-ccw.h"
-// #define DEBUG_FALLBACK
+/* #define DEBUG_FALLBACK */
#ifdef DEBUG_FALLBACK
#define dputs(txt) \
struct scsi_blockptr blockptr;
} __attribute__ ((packed));
-#define ZIPL_MAGIC "zIPL"
+#define ZIPL_MAGIC "zIPL"
-#define ZIPL_COMP_HEADER_IPL 0x00
-#define ZIPL_COMP_HEADER_DUMP 0x01
+#define ZIPL_COMP_HEADER_IPL 0x00
+#define ZIPL_COMP_HEADER_DUMP 0x01
-#define ZIPL_COMP_ENTRY_LOAD 0x02
-#define ZIPL_COMP_ENTRY_EXEC 0x01
+#define ZIPL_COMP_ENTRY_LOAD 0x02
+#define ZIPL_COMP_ENTRY_EXEC 0x01
/* Scratch space */
static uint8_t sec[SECTOR_SIZE] __attribute__((__aligned__(SECTOR_SIZE)));
/* Check for ZIPL magic. Returns 0 if not matched. */
static int zipl_magic(uint8_t *ptr)
{
- uint32_t *p = (void*)ptr;
- uint32_t *z = (void*)ZIPL_MAGIC;
+ uint32_t *p = (void *)ptr;
+ uint32_t *z = (void *)ZIPL_MAGIC;
if (*p != *z) {
debug_print_int("invalid magic", *p);
static int zipl_load_segment(struct component_entry *entry)
{
const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr));
- struct scsi_blockptr *bprs = (void*)sec;
+ struct scsi_blockptr *bprs = (void *)sec;
const int bprs_size = sizeof(sec);
uint64_t blockno;
long address;
}
for (i = 0;; i++) {
- u64 *cur_desc = (void*)&bprs[i];
+ u64 *cur_desc = (void *)&bprs[i];
blockno = bprs[i].blockno;
- if (!blockno)
+ if (!blockno) {
break;
+ }
/* we need the updated blockno for the next indirect entry in the
chain, but don't want to advance address */
- if (i == (max_entries - 1))
+ if (i == (max_entries - 1)) {
break;
+ }
if (bprs[i].blockct == 0 && unused_space(&bprs[i + 1],
sizeof(struct scsi_blockptr))) {
break;
}
address = virtio_load_direct(cur_desc[0], cur_desc[1], 0,
- (void*)address);
- if (address == -1)
+ (void *)address);
+ if (address == -1) {
goto fail;
+ }
}
} while (blockno);
entry++;
- if ((uint8_t*)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) {
+ if ((uint8_t *)(&entry[1]) > (tmp_sec + SECTOR_SIZE)) {
goto fail;
}
}
int zipl_load(void)
{
- struct mbr *mbr = (void*)sec;
+ struct mbr *mbr = (void *)sec;
uint8_t *ns, *ns_end;
int program_table_entries = 0;
int pte_len = sizeof(struct scsi_blockptr);
const char *error = "";
/* Grab the MBR */
- virtio_read(0, (void*)mbr);
+ virtio_read(0, (void *)mbr);
dputs("checking magic\n");
#define PAGE_SIZE 4096
#ifndef EIO
-#define EIO 1
+#define EIO 1
#endif
#ifndef EBUSY
-#define EBUSY 2
+#define EBUSY 2
#endif
#ifndef NULL
#define NULL 0
/* virtio.c */
unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2,
- ulong subchan_id, void *load_addr);
+ ulong subchan_id, void *load_addr);
bool virtio_is_blk(struct subchannel_id schid);
void virtio_setup_block(struct subchannel_id schid);
int virtio_read(ulong sector, void *load_addr);
static inline void print_int(const char *desc, u64 addr)
{
- unsigned char *addr_c = (unsigned char*)&addr;
+ unsigned char *addr_c = (unsigned char *)&addr;
char out[] = ": 0xffffffffffffffff\n";
unsigned int i;
* Hypercall functions *
***********************************************/
-#define KVM_S390_VIRTIO_NOTIFY 0
-#define KVM_S390_VIRTIO_RESET 1
-#define KVM_S390_VIRTIO_SET_STATUS 2
+#define KVM_S390_VIRTIO_NOTIFY 0
+#define KVM_S390_VIRTIO_RESET 1
+#define KVM_S390_VIRTIO_SET_STATUS 2
#define KVM_S390_VIRTIO_CCW_NOTIFY 3
static inline void yield(void)
{
- asm volatile ("diag 0,0,0x44"
- : :
- : "memory", "cc");
+ asm volatile ("diag 0,0,0x44"
+ : :
+ : "memory", "cc");
}
#define SECTOR_SIZE 512
static void sclp_set_write_mask(void)
{
- WriteEventMask *sccb = (void*)_sccb;
+ WriteEventMask *sccb = (void *)_sccb;
sccb->h.length = sizeof(WriteEventMask);
sccb->mask_length = sizeof(unsigned int);
void sclp_print(const char *str)
{
int len = _strlen(str);
- WriteEventData *sccb = (void*)_sccb;
+ WriteEventData *sccb = (void *)_sccb;
sccb->h.length = sizeof(WriteEventData) + len;
sccb->h.function_code = SCLP_FC_NORMAL_WRITE;
static long kvm_hypercall(unsigned long nr, unsigned long param1,
unsigned long param2)
{
- register ulong r_nr asm("1") = nr;
- register ulong r_param1 asm("2") = param1;
- register ulong r_param2 asm("3") = param2;
- register long retval asm("2");
+ register ulong r_nr asm("1") = nr;
+ register ulong r_param1 asm("2") = param1;
+ register ulong r_param2 asm("3") = param2;
+ register long retval asm("2");
- asm volatile ("diag 2,4,0x500"
- : "=d" (retval)
- : "d" (r_nr), "0" (r_param1), "r"(r_param2)
- : "memory", "cc");
+ asm volatile ("diag 2,4,0x500"
+ : "=d" (retval)
+ : "d" (r_nr), "0" (r_param1), "r"(r_param2)
+ : "memory", "cc");
- return retval;
+ return retval;
}
static void virtio_notify(struct subchannel_id schid)
{
- kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32*)&schid, 0);
+ kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32 *)&schid, 0);
}
/***********************************************
}
unsigned long virtio_load_direct(ulong rec_list1, ulong rec_list2,
- ulong subchan_id, void *load_addr)
+ ulong subchan_id, void *load_addr)
{
u8 status;
int sec = rec_list1;
}
sclp_print(".");
- status = virtio_read_many(sec, (void*)addr, sec_num);
+ status = virtio_read_many(sec, (void *)addr, sec_num);
if (status) {
virtio_panic("I/O Error");
}
if (run_ccw(schid, CCW_CMD_READ_VQ_CONF, &config, sizeof(config))) {
virtio_panic("Could not get block device configuration\n");
}
- vring_init(&block, config.num, (void*)(100 * 1024 * 1024),
+ vring_init(&block, config.num, (void *)(100 * 1024 * 1024),
KVM_S390_VIRTIO_RING_ALIGN);
info.queue = (100ULL * 1024ULL* 1024ULL);
char *config;
};
-#define KVM_S390_VIRTIO_RING_ALIGN 4096
+#define KVM_S390_VIRTIO_RING_ALIGN 4096
#define VRING_USED_F_NO_NOTIFY 1