SMP: allow compilation with clang

Change-Id: Iec57820d150f2436cb3b7c543f662d3313197a4c
This commit is contained in:
2015-06-11 14:35:12 +02:00
committed by Lionel Sambuc
parent b7f0178aeb
commit b7d7e202a9
4 changed files with 9 additions and 3 deletions

View File

@@ -1959,7 +1959,7 @@ do_pcibridge(int busind)
* pci_intel_init *
*===========================================================================*/
static void
pci_intel_init()
pci_intel_init(void)
{
/* Try to detect a know PCI controller. Read the Vendor ID and
* the Device ID for function 0 of device 0.

View File

@@ -19,6 +19,10 @@
#if defined(CONFIG_SMP) && defined(__GNUC__)
#ifndef __ASSEMBLY__
#include <limits.h>
#include <sys/types.h>
static inline void bits_fill(bitchunk_t * chunks, unsigned bits)
{
unsigned c, cnt;

View File

@@ -84,6 +84,8 @@ OBJS.kernel+= ${UNPAGED_OBJS}
.ifdef CONFIG_SMP
SRCS += arch_smp.c trampoline.S
# trampoline.S uses .code16, which is unsupported by clang.
AFLAGS.trampoline.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
.endif
.if ${USE_ACPI} != "no"

View File

@@ -19,9 +19,9 @@ typedef struct spinlock {
#else
/* SMP */
#define SPINLOCK_DEFINE(name) spinlock_t name;
#define SPINLOCK_DEFINE(name) spinlock_t name = { .val = 0 };
#define PRIVATE_SPINLOCK_DEFINE(name) PRIVATE SPINLOCK_DEFINE(name)
#define SPINLOCK_DECLARE(name) extern SPINLOCK_DEFINE(name)
#define SPINLOCK_DECLARE(name) extern spinlock_t name;
#define spinlock_init(sl) do { (sl)->val = 0; } while (0)
#if CONFIG_MAX_CPUS == 1