[coreboot-gerrit] New patch to review for coreboot: mainboard/emulation: Use C89 comments style & remove commented code
HAOUAS Elyes (ehaouas@noos.fr)
gerrit at coreboot.org
Fri Oct 7 13:03:28 CEST 2016
HAOUAS Elyes (ehaouas at noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16916
-gerrit
commit d0044e0c5625d90cb2af11fac4147a4c3632adc2
Author: Elyes HAOUAS <ehaouas at noos.fr>
Date: Fri Oct 7 13:02:31 2016 +0200
mainboard/emulation: Use C89 comments style & remove commented code
Change-Id: I627338505fe1273366bc8f6f528d829b3162b371
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
src/mainboard/emulation/qemu-i440fx/romstage.c | 3 ---
src/mainboard/emulation/qemu-power8/bootblock.c | 4 ++--
src/mainboard/emulation/qemu-power8/mainboard.c | 2 +-
src/mainboard/emulation/qemu-q35/acpi_tables.c | 2 +-
src/mainboard/emulation/qemu-q35/romstage.c | 3 ---
src/mainboard/emulation/qemu-riscv/bootblock.c | 4 ++--
src/mainboard/emulation/qemu-riscv/qemu_util.c | 18 +++++++-----------
src/mainboard/emulation/spike-riscv/bootblock.c | 4 ++--
src/mainboard/emulation/spike-riscv/spike_util.c | 5 ++---
9 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/src/mainboard/emulation/qemu-i440fx/romstage.c b/src/mainboard/emulation/qemu-i440fx/romstage.c
index bc23929..1676fb0 100644
--- a/src/mainboard/emulation/qemu-i440fx/romstage.c
+++ b/src/mainboard/emulation/qemu-i440fx/romstage.c
@@ -40,9 +40,6 @@ void * asmlinkage romstage_main(unsigned long bist)
/* Halt if there was a built in self test failure */
report_bist_failure(bist);
- //print_pci_devices();
- //dump_pci_devices();
-
cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(timestamp_get());
diff --git a/src/mainboard/emulation/qemu-power8/bootblock.c b/src/mainboard/emulation/qemu-power8/bootblock.c
index d92c169..9927fdc 100644
--- a/src/mainboard/emulation/qemu-power8/bootblock.c
+++ b/src/mainboard/emulation/qemu-power8/bootblock.c
@@ -17,8 +17,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/qemu-power8/mainboard.c b/src/mainboard/emulation/qemu-power8/mainboard.c
index 102f54c..41df2ca 100644
--- a/src/mainboard/emulation/qemu-power8/mainboard.c
+++ b/src/mainboard/emulation/qemu-power8/mainboard.c
@@ -26,7 +26,7 @@ static void mainboard_enable(device_t dev)
;
}
- // Where does RAM live?
+ /* Where does RAM live? */
ram_resource(dev, 0, 2048, 32768);
cbmem_recovery(0);
}
diff --git a/src/mainboard/emulation/qemu-q35/acpi_tables.c b/src/mainboard/emulation/qemu-q35/acpi_tables.c
index 07589e1..1b32c02 100644
--- a/src/mainboard/emulation/qemu-q35/acpi_tables.c
+++ b/src/mainboard/emulation/qemu-q35/acpi_tables.c
@@ -204,7 +204,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
return current;
reg = pci_read_config32(dev, 0x60);
- if ((reg & 0x07) != 0x01) // require enabled + 256MB size
+ if ((reg & 0x07) != 0x01) /* require enabled + 256MB size */
return current;
current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *) current,
diff --git a/src/mainboard/emulation/qemu-q35/romstage.c b/src/mainboard/emulation/qemu-q35/romstage.c
index 1bb51da..870dd07 100644
--- a/src/mainboard/emulation/qemu-q35/romstage.c
+++ b/src/mainboard/emulation/qemu-q35/romstage.c
@@ -42,9 +42,6 @@ void * asmlinkage romstage_main(unsigned long bist)
/* Halt if there was a built in self test failure */
report_bist_failure(bist);
- //print_pci_devices();
- //dump_pci_devices();
-
cbmem_was_initted = !cbmem_recovery(0);
timestamp_init(timestamp_get());
diff --git a/src/mainboard/emulation/qemu-riscv/bootblock.c b/src/mainboard/emulation/qemu-riscv/bootblock.c
index 3e88620..14286e3 100644
--- a/src/mainboard/emulation/qemu-riscv/bootblock.c
+++ b/src/mainboard/emulation/qemu-riscv/bootblock.c
@@ -18,8 +18,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/qemu-riscv/qemu_util.c b/src/mainboard/emulation/qemu-riscv/qemu_util.c
index 216eea9..01a4c61 100644
--- a/src/mainboard/emulation/qemu-riscv/qemu_util.c
+++ b/src/mainboard/emulation/qemu-riscv/qemu_util.c
@@ -33,8 +33,7 @@
#include <string.h>
uintptr_t translate_address(uintptr_t vAddr) {
- // TODO: implement the page table translation algorithm
- //uintptr_t pageTableRoot = read_csr(sptbr);
+ /* TODO: implement the page table translation algorithm */
uintptr_t physAddrMask = 0xfffffff;
uintptr_t translationResult = vAddr & physAddrMask;
printk(BIOS_DEBUG, "Translated virtual address 0x%llx to physical address 0x%llx\n", vAddr, translationResult);
@@ -46,7 +45,7 @@ uintptr_t mcall_query_memory(uintptr_t id, memory_block_info *p)
uintptr_t physicalAddr = translate_address((uintptr_t) p);
memory_block_info *info = (memory_block_info*) physicalAddr;
if (id == 0) {
- info->base = 0x1000000; // hard coded for now, but we can put these values somewhere later
+ info->base = 0x1000000; /* hard coded for now, but we can put these values somewhere later */
info->size = 0x7F000000 - info->base;
return 0;
}
@@ -62,7 +61,7 @@ uintptr_t mcall_send_ipi(uintptr_t recipient)
uintptr_t mcall_clear_ipi(void)
{
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
if (HLS()->device_response_queue_head == NULL) {
clear_csr(mip, MIP_SSIP);
mb();
@@ -104,13 +103,12 @@ uintptr_t mcall_dev_resp(void)
sbi_device_message* m = HLS()->device_response_queue_head;
if (m) {
- //printm("resp %p\n", m);
sbi_device_message* next = (void*)atomic_read(&m->sbi_private_data);
HLS()->device_response_queue_head = next;
if (!next) {
HLS()->device_response_queue_tail = 0;
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
clear_csr(mip, MIP_SSIP);
mb();
if (HLS()->ipi_pending) set_csr(mip, MIP_SSIP);
@@ -153,7 +151,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
if (m->dev == dev && m->cmd == cmd) {
m->data = data;
- // dequeue from request queue
+ /* dequeue from request queue */
if (prev)
prev->sbi_private_data = (uintptr_t)next;
else
@@ -161,7 +159,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
HLS()->device_request_queue_size = n-1;
m->sbi_private_data = 0;
- // enqueue to response queue
+ /* enqueue to response queue */
if (HLS()->device_response_queue_tail)
{
HLS()->device_response_queue_tail->sbi_private_data = (uintptr_t)m;
@@ -172,7 +170,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
}
HLS()->device_response_queue_tail = m;
- // signal software interrupt
+ /* signal software interrupt */
set_csr(mip, MIP_SSIP);
return 0;
}
@@ -180,9 +178,7 @@ uintptr_t htif_interrupt(uintptr_t mcause, uintptr_t* regs) {
prev = m;
m = (void*)atomic_read(&m->sbi_private_data);
}
- //HLT();
return 0;
- //panic("htif: no record");
}
uintptr_t mcall_console_putchar(uint8_t ch)
diff --git a/src/mainboard/emulation/spike-riscv/bootblock.c b/src/mainboard/emulation/spike-riscv/bootblock.c
index 40a7de1..c4c886c 100644
--- a/src/mainboard/emulation/spike-riscv/bootblock.c
+++ b/src/mainboard/emulation/spike-riscv/bootblock.c
@@ -18,8 +18,8 @@
#include <console/console.h>
#include <program_loading.h>
-// the qemu part of all this is very, very non-hardware like.
-// so it gets its own bootblock.
+/* the qemu part of all this is very, very non-hardware like. */
+/* so it gets its own bootblock. */
void main(void)
{
if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {
diff --git a/src/mainboard/emulation/spike-riscv/spike_util.c b/src/mainboard/emulation/spike-riscv/spike_util.c
index 7ddf16b..26789b4 100644
--- a/src/mainboard/emulation/spike-riscv/spike_util.c
+++ b/src/mainboard/emulation/spike-riscv/spike_util.c
@@ -34,8 +34,7 @@
#include <vm.h>
uintptr_t translate_address(uintptr_t vAddr) {
- // TODO: implement the page table translation algorithm
- //uintptr_t pageTableRoot = read_csr(sptbr);
+ /* TODO: implement the page table translation algorithm */
uintptr_t physAddrMask = 0xfffffff;
uintptr_t translationResult = vAddr & physAddrMask;
printk(BIOS_DEBUG, "Translated virtual address 0x%llx to physical address 0x%llx\n", vAddr, translationResult);
@@ -63,7 +62,7 @@ uintptr_t mcall_send_ipi(uintptr_t recipient)
uintptr_t mcall_clear_ipi(void)
{
- // only clear SSIP if no other events are pending
+ /* only clear SSIP if no other events are pending */
if (HLS()->device_response_queue_head == NULL) {
clear_csr(mip, MIP_SSIP);
mb();
More information about the coreboot-gerrit
mailing list