Commit graph

368 commits

Author SHA1 Message Date
Haiyue Wang
d0f957ae85 qemu-intel64: Fixes the linker 'noexecstack' warning
Fix the linker warning based on these two commits:

 ld: warning: fork.o: missing .note.GNU-stack section implies executable stack
 ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker

commit 36ac812114 ("sim: Fixes the following linker warning:"),
commit b5d640acc5 ("fix Cygwin/MSYS2  ld: unrecognized option '-z'")
2024-10-26 11:10:43 +08:00
cuiziwei
12fd5ec472 nuttx: Add LIBSUPCXX_TOOLCHAIN to link the prebuilt library provide by toolchain.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-24 01:38:03 +08:00
liwenxiang1
eb722794b5 arch/x86_64:Fix variable used before assignment
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-23 14:28:59 +08:00
cuiziwei
541f30878a arch/x86_64:Add CXX configuration for enabling x86_64 support for C++ applications.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-18 23:53:35 +08:00
Xiang Xiao
c6aed84638 tools: Rename apps-or-nuttx-Make.defs to Make.defs
follow the same pattern as other Make.defs files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-10-17 07:55:02 +08:00
yangsong8
8c13b8df1d syslog: convert \n to \r\n in syslog framework layer
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2024-10-17 02:29:51 +08:00
liwenxiang1
eb27ebba8a arch/x86_64: The AP retrieves this_task after storing the CPU private data
this_task obtains the CPU ID through the GS register, so the initial value of GS needs to be configured in x86_64_cpu_priv_set

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>

x86_64/intel64: fix SMP compilation warnings

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-16 22:09:00 +08:00
liwenxiang1
8a1743d0a6 arch/x86_64: Resolving NUC Boot Failure Issue
The segment of the Xen PVH boot protocol was not specified during linking and was placed before .loader.text, causing the boot to fail

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-16 13:53:11 +08:00
cuiziwei
036a0674db nuttx/libc:Add _dl_find_object and dl_iterate_phdr function.
Add _dl_find_object() function, because when cxx_exception configuration is enabled, a link error occurs and that function cannot be found.

ld: /usr/lib/gcc/x86_64-linux-gnu/13/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x250c): undefined reference to `_dl_find_object'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-15 12:35:54 +08:00
cuiziwei
a08df48774 arch/x86_64:Add CXX configuration for enabling x86_64 support for C++ applications.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-14 19:03:30 +08:00
liwenxiang1
3e2e2132ca arch/x86_64:Adjust the position of the nm command to execute it after NuttX is generated
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-14 17:55:59 +08:00
p-szafonimateusz
c18f722185 arch/intel64: optimise context switch
We save interrupted TCB state on tcb->xcp.regs not interrupt stack now
which allows us to remove x86_64_savestate() from up_switch_context()
and other places.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-14 17:54:06 +08:00
Bowen Wang
143466baed drivers/pci: fix pci framework warning in 32bit chip
In file included from pci/pci.c:30:
pci/pci.c: In function 'pci_setup_device':
pci/pci.c:449:66: warning: right shift count >= width of type [-Wshift-count-overflow]
  449 |           pci_write_config_dword(dev, base_address_1, res->start >> 32);
      |                                                                  ^~
pci/pci.c: In function 'pci_presetup_bridge':
pci/pci.c:541:51: warning: right shift count >= width of type [-Wshift-count-overflow]
  541 |                              ctrl->mem_pref.start >> 32);
      |                                                   ^~
pci/pci.c: In function 'pci_postsetup_bridge':
pci/pci.c:604:57: warning: right shift count >= width of type [-Wshift-count-overflow]
  604 |                              (ctrl->mem_pref.start - 1) >> 32);
      |                                                         ^~
CC:  pthread/pthread_release.c pci/pci_ecam.c:71:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int *)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t *)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int *)'} [-Wincompatible-pointer-types]
   71 |   .read  = pci_ecam_read_config,
      |            ^~~~~~~~~~~~~~~~~~~~
pci/pci_ecam.c:71:12: note: (near initialization for 'g_pci_ecam_ops.read')
pci/pci_ecam.c:72:12: warning: initialization of 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, unsigned int,  int,  int,  long unsigned int)'} from incompatible pointer type 'int (*)(struct pci_bus_s *, uint32_t,  int,  int,  uint32_t)' {aka 'int (*)(struct pci_bus_s *, long unsigned int,  int,  int,  long unsigned int)'} [-Wincompatible-pointer-types]
   72 |   .write = pci_ecam_write_config,

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-13 02:28:32 +08:00
xuxin19
7b807a3947 cmake:fix x86_64 cmake configured warning
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:08:38 +08:00
anjiahao
e5f9b42ea0 binfmt/libelf:Remove libelf implementation [2/2]
this commit is part two, all logic move to modlib, so we can remove it.
and change all use defconfig

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2024-10-12 12:29:06 +08:00
liwenxiang1
43a8a80c74 arch/x86_64:Code style is consistent
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-12 11:20:24 +08:00
hujun5
302d2f3b56 x86_64: align some code
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-12 10:19:48 +08:00
liwenxiang1
9eb7665822 arch/x86_64:Change extern g_intstackalloc to g_isrstackalloc
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-11 19:55:50 +08:00
wangyongrong
933e066118 common/Toolchain.defs: support CONFIG_DEBUG_NOOPT for x86_64
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-10-11 17:21:06 +08:00
Bowen Wang
20db146b64 x86/x86_64: change the build result from nuttx.elf to nuttx
Just sync with other architecture.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-10-11 17:20:15 +08:00
ouyangxiangzhen
0936c97d3e arch/x86_64: Fix SMP startup for ACRN Hypervisor
This patch fixed SMP startup for ACRN Hypervisor.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-11 15:43:01 +08:00
liwenxiang1
9189800760 arch/x86_64:Add configuration to disable vectorization optimization
With aggresive optimization enabled (-O3), ostest FPU test will fail.This is because the compiler will generate additional vector instructions between subsequent up_fpucmp() calls (loop vectorization somewhere in usleep() call), which will consequently overwrite the expected FPU context (XMM registers).The compilation option -fno-tree-vectorize can avoid this issue.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-11 15:40:55 +08:00
andi6
19e34b7f6e x64: modify addr limit to support 64 bits addr backtrace
Signed-off-by: andi6 <andi6@xiaomi.com>
2024-10-11 15:32:28 +08:00
cuiziwei
5e96e72cb6 X86_64: Add libcxx availability macros.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 13:53:10 +08:00
cuiziwei
1816d752af arch/x86_64:Fix build cxx warning.
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-11 13:46:27 +08:00
p-szafonimateusz
ed71aa810e arch/x86_64/intel64/intel64_irq.c: fix busy irq logic
use correct macro for cpu_set_t busy variable and remove obsolote check

also remove not needed #include <sched.h> and "Public data"

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-10-10 22:57:04 +08:00
liwenxiang1
fee7e0ce81 arch/x86_64:Add macros related to CPUID
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 15:07:45 +02:00
ouyangxiangzhen
d0779e0eef arch/x86_64: Fix up_timer compilation error
This commit fix up_timer compilation error.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
ouyangxiangzhen
e6548ead20 arch/x86_64: Fix up_timer_start
Fix according to up_alarm_start.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2024-10-10 15:07:22 +02:00
liwenxiang1
24f54ba712 arch/x86_64: cache convert all asm() to __asm__()
asm() is not supported by -std=c99, __asm__() is more portable

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 18:36:09 +08:00
andi6
2ed88f8813 x64: add acrn ioapic init support
if we two step to set interrupt trigger and disable interrupt,
acrn will inject #GP exception

Signed-off-by: andi6 <andi6@xiaomi.com>
2024-10-10 17:49:40 +08:00
liwenxiang1
8d2fc5c9ee arch/x86_64:Add nanosecond delay interface to TSC
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 17:13:01 +08:00
cuiziwei
f86644141b x86_64:Fix ld error.
LD: nuttx.elf
ld:in function `std::__1::ios_base::imbue(std::__1::locale const&)':
nuttx/libs/libxx/libcxx/src/ios.cpp:129: undefined reference to `_Unwind_Resume'

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2024-10-10 16:51:38 +08:00
liwenxiang1
f858026819 arch/x86_64:Add allsymbol functionality
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 14:56:08 +08:00
liwenxiang1
e3b3a6145a arch/x86_64: idle convert all asm() to __asm__()
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 13:40:39 +08:00
liwenxiang1
1af831e139 arch/x86_64: cpuid expect 32 bit variables
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:03:27 +08:00
liwenxiang1
2448e8a59e arch/x86_64:Add perf tool
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 12:01:16 +08:00
liwenxiang1
f81c7dbc93 arch/x86_64:Use the checkstack function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-10 11:40:15 +08:00
hujun5
e249dd2672 arch: support customized up_cpu_index() in AMP mode
Some app with same code runs on different cores in AMP mode,
need the physical core on which the function is called.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2024-10-10 02:38:40 +08:00
liwenxiang1
4c19e75ff5 libs/x86_64:Add the setjmp/longjmp function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 22:24:03 +08:00
yinshengkai
034af29aab arch: adjust gcov configuration name
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2024-10-09 21:27:47 +08:00
liwenxiang1
8fe6c0ee8e arch/x86_64: Map the new page table with read-write permissions
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 20:51:58 +08:00
liwenxiang1
eb411101c5 arch/x86_64:Configure arch delay using CONFIG_ALARM_ARCH
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 20:49:19 +08:00
liwenxiang1
8b86f5de60 arch/x86_64: add support for thread_local
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 17:58:01 +08:00
liwenxiang1
5e15fff58a arch/x68_64: properly align ap boot stack for vector operations
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 17:40:37 +08:00
liwenxiang1
b4c4cbc28b arch/x86_64: Resolve weak symbol compilation relocation errors
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 17:39:42 +08:00
liwenxiang1
cd03ec3266 arch/x86_64:Add check stack function
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 01:53:09 +08:00
liwenxiang1
afe1cc59b6 arch/x86_64: Add vfork support
Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2024-10-09 01:41:35 +08:00
yinshengkai
f26ae83900 arch/irq: add the up_getusrpc macro to get the PC of the interrupted thread in the interrupt
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-10-08 19:55:28 +08:00
hujun5
99b364c880 x86_64: fix regression
This commit fixes the regression from https://github.com/apache/nuttx/pull/13768

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-08 15:27:57 +08:00