Skip to content

Commit

Permalink
do not mix tabs and spaces in a single file
Browse files Browse the repository at this point in the history
  • Loading branch information
bonzini committed Jul 24, 2019
1 parent e7fc653 commit 0f14738
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
26 changes: 13 additions & 13 deletions cstart.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ ENTRY(pm_entry)
mov %ax, %ss
mov $0x7c00, %sp

mov %cr0, %eax
and $~((1 << 30) | (1 << 29)), %eax # clear CD and NW
or $1, %al
mov %eax, %cr0
lgdtl %cs:0xff80 + gdt32_descr - pm_entry
ljmpl $8, $0xffffff80 + 2f - pm_entry
mov %cr0, %eax
and $~((1 << 30) | (1 << 29)), %eax # clear CD and NW
or $1, %al
mov %eax, %cr0
lgdtl %cs:0xff80 + gdt32_descr - pm_entry
ljmpl $8, $0xffffff80 + 2f - pm_entry
2:
.code32
mov $16, %ax
Expand All @@ -27,16 +27,16 @@ ENTRY(pm_entry)
ljmp $8, $0xffff0000

gdt32:
.quad 0
.quad 0x00cf9b000000ffff // flat 32-bit code segment
.quad 0x00cf93000000ffff // flat 32-bit data segment
.quad 0x000f9b0f0000ffff // 64K 16-bit code segment at 0xF0000
.quad 0x000f93000000ffff // 64K 16-bit data segment at 0x0
.quad 0
.quad 0x00cf9b000000ffff // flat 32-bit code segment
.quad 0x00cf93000000ffff // flat 32-bit data segment
.quad 0x000f9b0f0000ffff // 64K 16-bit code segment at 0xF0000
.quad 0x000f93000000ffff // 64K 16-bit data segment at 0x0
gdt32_end:

gdt32_descr:
.word gdt32_end - gdt32 - 1
.long 0xffffff80 + gdt32 - pm_entry
.word gdt32_end - gdt32 - 1
.long 0xffffff80 + gdt32 - pm_entry
ENTRY_END(pm_entry)

.code16gcc
Expand Down
30 changes: 15 additions & 15 deletions fw_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ void fw_cfg_setup(void)

int filenamecmp(const char *a, const struct fw_cfg_file *f)
{
int n = sizeof(f->name);
const char *b = f->name;
while (*a == *b) {
if (*a == '\0') {
break;
}
if (--n == 0) {
return *a;
}
++a, ++b;
}
return *a - *b;
int n = sizeof(f->name);
const char *b = f->name;
while (*a == *b) {
if (*a == '\0') {
break;
}
if (--n == 0) {
return *a;
}
++a, ++b;
}
return *a - *b;
}

int fw_cfg_file_id(char *name)
Expand Down Expand Up @@ -89,9 +89,9 @@ void fw_cfg_read_file(int id, void *buf, int len)
}

struct fw_cfg_dma_descriptor {
uint32_t control;
uint32_t length;
uint64_t address;
uint32_t control;
uint32_t length;
uint64_t address;
} __attribute__((packed));

void fw_cfg_dma(int control, void *buf, int len)
Expand Down
44 changes: 22 additions & 22 deletions hwsetup.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void setup_piix_pm(void)
{
const int bdf = (1 << 3) | 3;

pci_config_writel(bdf, PIIX_PMBASE, 0x601);
pci_config_writel(bdf, PIIX_PMBASE, 0x601);
pci_config_writeb(bdf, PIIX_PMREGMISC, 0x01);
pci_config_writel(bdf, PIIX_SMBHSTBASE, 0x701);
pci_config_writeb(bdf, PIIX_SMBHSTCFG, 0x09);
Expand Down Expand Up @@ -61,25 +61,25 @@ static void setup_ich9_pm(void)

static void setup_pic(void)
{
/* Send ICW1 (select OCW1 + will send ICW4) */
outb(0x20, 0x11);
outb(0xa0, 0x11);
/* Send ICW2 (base irqs: 0x08-0x0f for irq0-7, 0x70-0x77 for irq8-15) */
outb(0x21, 8);
outb(0xa1, 0x70);
/* Send ICW3 (cascaded pic ids) */
outb(0x21, 0x04);
outb(0xa1, 0x02);
/* Send ICW4 (enable 8086 mode) */
outb(0x21, 0x01);
outb(0xa1, 0x01);
/* Mask all irqs (except cascaded PIC2 irq) */
outb(0x21, ~(1 << 2));
outb(0xa1, ~0);

/* Set ELCR to IRQs 10 and 11 */
outb(0x4d0, 0);
outb(0x4d1, 0x0c);
/* Send ICW1 (select OCW1 + will send ICW4) */
outb(0x20, 0x11);
outb(0xa0, 0x11);
/* Send ICW2 (base irqs: 0x08-0x0f for irq0-7, 0x70-0x77 for irq8-15) */
outb(0x21, 8);
outb(0xa1, 0x70);
/* Send ICW3 (cascaded pic ids) */
outb(0x21, 0x04);
outb(0xa1, 0x02);
/* Send ICW4 (enable 8086 mode) */
outb(0x21, 0x01);
outb(0xa1, 0x01);
/* Mask all irqs (except cascaded PIC2 irq) */
outb(0x21, ~(1 << 2));
outb(0xa1, ~0);

/* Set ELCR to IRQs 10 and 11 */
outb(0x4d0, 0);
outb(0x4d1, 0x0c);
}

void setup_pam(int bdf, int pambase)
Expand All @@ -103,8 +103,8 @@ void setup_hw(void)
int rom_check_value;
int pambase;

uint32_t id = pci_config_readl(bdf, 0);
if (id == (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_82441 << 16))) {
uint32_t id = pci_config_readl(bdf, 0);
if (id == (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_82441 << 16))) {
setup_piix();
setup_piix_pm();
pambase = I440FX_PAM0;
Expand Down
2 changes: 1 addition & 1 deletion include/linuxboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct linuxboot_args {
uint32_t setup_size, kernel_size;

/* Input */
uint32_t cmdline_size, vmlinuz_size, initrd_size;
uint32_t cmdline_size, vmlinuz_size, initrd_size;
uint8_t header[8192];
};

Expand Down
2 changes: 1 addition & 1 deletion linuxboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void boot_bzimage(struct linuxboot_args *args)
: :
"b" (((uintptr_t) args->setup_addr) >> 4),
"d" (args->cmdline_addr - args->setup_addr - 16));
panic();
panic();
}

/* BX = address of data block
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void extract_e820(void)
int __attribute__ ((section (".text.startup"))) main(void)
{
#ifdef BENCHMARK_HACK
outb(FW_EXIT_PORT, FW_START);
outb(FW_EXIT_PORT, FW_START);
#endif
setup_hw();

Expand Down
6 changes: 3 additions & 3 deletions pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static void do_setup_pci(uint32_t bdf, uint32_t id, uint8_t type)
uint8_t pin;

pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN);
if (pin != 0)
if (pin != 0)
do_setup_pci_irq(bdf, pin);

if (type & PCI_HEADER_TYPE_BRIDGE) {
Expand Down Expand Up @@ -164,8 +164,8 @@ void setup_pci(void)
{
const int bdf = 0;

uint32_t id = pci_config_readl(bdf, 0);
if (id == (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_82441 << 16)))
uint32_t id = pci_config_readl(bdf, 0);
if (id == (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_82441 << 16)))
use_i440fx_routing = true;
else if (id == (PCI_VENDOR_ID_INTEL | (PCI_DEVICE_ID_INTEL_Q35_MCH << 16)))
use_i440fx_routing = false;
Expand Down
4 changes: 2 additions & 2 deletions printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va)
print_str(&s, va_arg(va, const char *), props);
break;
}
addchar(&s, f);
break;
addchar(&s, f);
break;
} while(0);
}
*s.buffer = 0;
Expand Down

0 comments on commit 0f14738

Please sign in to comment.