You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/01/25 17:09:44 UTC
(nuttx) 05/06: fix various compilation errors after pci code rebase
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 2e758f33eea5e8dcd38f6e37061e53a3b6e076de
Author: raiden00pl <ra...@railab.me>
AuthorDate: Mon Jan 22 10:40:16 2024 +0100
fix various compilation errors after pci code rebase
---
arch/x86_64/Kconfig | 1 +
arch/x86_64/src/intel64/Make.defs | 2 +-
arch/x86_64/src/intel64/intel64_createstack.c | 2 +-
arch/x86_64/src/intel64/intel64_lowsetup.c | 14 ++++++++++++++
arch/x86_64/src/intel64/intel64_mbfb.c | 2 +-
arch/x86_64/src/intel64/intel64_serial.c | 17 ++++++++++-------
.../intel64/qemu-intel64/configs/pcitest/defconfig | 1 +
boards/x86_64/intel64/qemu-intel64/src/qemu_pci.c | 3 +--
drivers/virt/qemu_edu.c | 1 +
drivers/virt/qemu_pci_test.c | 1 +
10 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 5e1115ad0e..556f3d01e3 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -71,6 +71,7 @@ config ARCH_MULTIBOOT2
system to enable certain features like the low level framebuffer.
if ARCH_MULTIBOOT2
+
config MULTBOOT2_FB_TERM
bool "Multiboot2 framebuffer terminal"
default n
diff --git a/arch/x86_64/src/intel64/Make.defs b/arch/x86_64/src/intel64/Make.defs
index c2d6db49aa..7274d01e6b 100644
--- a/arch/x86_64/src/intel64/Make.defs
+++ b/arch/x86_64/src/intel64/Make.defs
@@ -38,7 +38,7 @@ CHIP_CSRCS += intel64_serial.c intel64_rng.c intel64_check_capability.c
# Configuration-dependent intel64 files
-ifeq ($(CONFIG_ARCH_MULTIBOOT2),y)
+ifeq ($(CONFIG_MULTBOOT2_FB_TERM),y)
CHIP_CSRCS += intel64_mbfb.c
endif
diff --git a/arch/x86_64/src/intel64/intel64_createstack.c b/arch/x86_64/src/intel64/intel64_createstack.c
index 6649cb06c8..f95086f5ff 100644
--- a/arch/x86_64/src/intel64/intel64_createstack.c
+++ b/arch/x86_64/src/intel64/intel64_createstack.c
@@ -161,7 +161,7 @@ int up_create_stack(struct tcb_s *tcb, size_t stack_size, uint8_t ttype)
if (!tcb->stack_alloc_ptr)
{
- serr("ERROR: Failed to allocate stack, size %d\n", stack_size);
+ serr("ERROR: Failed to allocate stack, size %zu\n", stack_size);
}
#endif
}
diff --git a/arch/x86_64/src/intel64/intel64_lowsetup.c b/arch/x86_64/src/intel64/intel64_lowsetup.c
index 988a9523ff..d28d7f6dcc 100644
--- a/arch/x86_64/src/intel64/intel64_lowsetup.c
+++ b/arch/x86_64/src/intel64/intel64_lowsetup.c
@@ -62,6 +62,15 @@ uint32_t mb_info_struct __attribute__((section(".loader.bss")));
* Private Functions
****************************************************************************/
+#ifdef CONFIG_ARCH_MULTIBOOT2
+/****************************************************************************
+ * Name: x86_64_mb2_config
+ *
+ * Description:
+ * Parse multiboot2 info.
+ *
+ ****************************************************************************/
+
static void x86_64_mb2_config(void)
{
struct multiboot_tag *tag;
@@ -82,18 +91,21 @@ static void x86_64_mb2_config(void)
break;
}
+#ifdef CONFIG_MULTBOOT2_FB_TERM
case MULTIBOOT_TAG_TYPE_FRAMEBUFFER:
{
x86_64_mb2_fbinitialize(
(struct multiboot_tag_framebuffer *)tag);
break;
}
+#endif
default:
break;
}
}
}
+#endif
/****************************************************************************
* Public Functions
@@ -133,9 +145,11 @@ void up_lowsetup(void)
x86_64_check_and_enable_capability();
+#ifdef CONFIG_ARCH_MULTIBOOT2
/* Handle multiboot2 info */
x86_64_mb2_config();
+#endif
/* Revoke the lower memory */
diff --git a/arch/x86_64/src/intel64/intel64_mbfb.c b/arch/x86_64/src/intel64/intel64_mbfb.c
index f536cffb35..0aacba8be2 100644
--- a/arch/x86_64/src/intel64/intel64_mbfb.c
+++ b/arch/x86_64/src/intel64/intel64_mbfb.c
@@ -34,7 +34,7 @@
#include <nuttx/nx/nxfonts.h>
#endif
-#include "up_internal.h"
+#include "x86_64_internal.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/arch/x86_64/src/intel64/intel64_serial.c b/arch/x86_64/src/intel64/intel64_serial.c
index dffd6304c9..d8fe7e81ee 100644
--- a/arch/x86_64/src/intel64/intel64_serial.c
+++ b/arch/x86_64/src/intel64/intel64_serial.c
@@ -82,6 +82,11 @@ void uart_putreg(uart_addrwidth_t base, unsigned int offset,
*
****************************************************************************/
+void up_lowputc(char ch)
+{
+ fb_putc(ch);
+}
+
int up_putc(int ch)
{
/* Check for LF */
@@ -90,19 +95,16 @@ int up_putc(int ch)
{
/* Add CR */
- x86_64_lowputc('\r');
+ up_lowputc('\r');
}
- x86_64_lowputc(ch);
+ up_lowputc(ch);
return ch;
}
-
-void up_lowputc(char ch)
-{
- fb_putc(ch);
-}
#endif /* USE_SERIALDRIVER */
+#ifdef USE_EARLYSERIALINIT
+
void x86_64_earlyserialinit(void)
{
u16550_earlyserialinit();
@@ -112,3 +114,4 @@ void x86_64_serialinit(void)
{
u16550_serialinit();
}
+#endif
diff --git a/boards/x86_64/intel64/qemu-intel64/configs/pcitest/defconfig b/boards/x86_64/intel64/qemu-intel64/configs/pcitest/defconfig
index 17f6e7cc8a..000ed38c84 100644
--- a/boards/x86_64/intel64/qemu-intel64/configs/pcitest/defconfig
+++ b/boards/x86_64/intel64/qemu-intel64/configs/pcitest/defconfig
@@ -30,6 +30,7 @@ CONFIG_DEBUG_PCI=y
CONFIG_DEBUG_PCI_ERROR=y
CONFIG_DEBUG_PCI_INFO=y
CONFIG_DEBUG_PCI_WARN=y
+CONFIG_DEBUG_SYMBOLS=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_EXAMPLES_HELLO_STACKSIZE=4194304
CONFIG_FS_PROCFS=y
diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_pci.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_pci.c
index d2bbd79102..ed1873633a 100644
--- a/boards/x86_64/intel64/qemu-intel64/src/qemu_pci.c
+++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_pci.c
@@ -29,8 +29,7 @@
#include <nuttx/pci/pci.h>
-#include "up_arch.h"
-#include "up_internal.h"
+#include "x86_64_internal.h"
/****************************************************************************
* Pre-processor Definitions
diff --git a/drivers/virt/qemu_edu.c b/drivers/virt/qemu_edu.c
index 953d161a52..4b71fd9485 100644
--- a/drivers/virt/qemu_edu.c
+++ b/drivers/virt/qemu_edu.c
@@ -27,6 +27,7 @@
#include <nuttx/irq.h>
#include <nuttx/kmalloc.h>
+#include <debug.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
diff --git a/drivers/virt/qemu_pci_test.c b/drivers/virt/qemu_pci_test.c
index b0556b4d9f..747ea2130a 100644
--- a/drivers/virt/qemu_pci_test.c
+++ b/drivers/virt/qemu_pci_test.c
@@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <nuttx/arch.h>
+#include <debug.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>