Skip to content

Commit

Permalink
Add support for QNX 6.6 platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
willmmiles authored and acpibob committed Mar 8, 2016
1 parent 0af0f90 commit 37a1dec
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 1 deletion.
4 changes: 4 additions & 0 deletions generate/unix/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
ifeq ($(HOST), _FreeBSD)
HARDWARE_NAME := $(shell uname -p)
else
ifeq ($(HOST), _QNX)
HARDWARE_NAME := x86pc
else
HARDWARE_NAME := $(shell uname -m)
endif
endif

#
# Main rule will only generate versions that are appropriate for the running
Expand Down
12 changes: 12 additions & 0 deletions generate/unix/Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ ifeq ($(UNAME_S), NetBSD)
HOST = _NetBSD
endif

ifeq ($(UNAME_S), QNX)
HOST = _QNX
endif

ifeq ($(HOST), _APPLE)
INSTALL = cp
INSTALLFLAGS ?= -f
Expand Down Expand Up @@ -163,6 +167,14 @@ CFLAGS += \
-D$(HOST)\
-D_GNU_SOURCE\
-I$(ACPICA_INCLUDE)

#
# QNX requires __EXT to enable most functions in its C library, analogous
# to _GNU_SOURCE.
#
ifeq ($(HOST), _QNX)
CFLAGS+=-D__EXT
endif

#
# Common compiler warning flags. The warning flags in addition
Expand Down
4 changes: 4 additions & 0 deletions generate/unix/acpidump/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ ifeq ($(HOST), _NetBSD)
HOST_FAMILY = BSD
endif

ifeq ($(HOST), _QNX)
HOST_FAMILY = BSD
endif

ifeq ($(HOST_FAMILY), BSD)
OBJECTS += \
$(OBJDIR)/osbsdtbl.o
Expand Down
4 changes: 4 additions & 0 deletions generate/unix/acpiexec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,15 @@ CFLAGS += \
-DACPI_CHECKSUM_ABORT=TRUE
endif

ifneq ($(HOST),_QNX)
LDFLAGS += -lpthread
endif

ifneq ($(HOST),_APPLE)
ifneq ($(HOST),_QNX)
LDFLAGS += -lrt
endif
endif

#
# Common Rules
Expand Down
3 changes: 3 additions & 0 deletions source/include/platform/acenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@
#elif defined(__HAIKU__)
#include "achaiku.h"

#elif defined(__QNX__)
#include "acqnx.h"

#else

/* Unknown environment */
Expand Down
37 changes: 37 additions & 0 deletions source/include/platform/acqnx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/******************************************************************************
*
* Name: acqnx.h - OS specific defines, etc.
*
*****************************************************************************/

#ifndef __ACQNX_H__
#define __ACQNX_H__

/* QNX uses GCC */

#include "acgcc.h"

#define ACPI_UINTPTR_T uintptr_t
#define ACPI_USE_LOCAL_CACHE
#define ACPI_CAST_PTHREAD_T(x) ((ACPI_THREAD_ID) ACPI_TO_INTEGER (x))

/* At present time (QNX 6.6) all supported architectures are 32 bits. */
#define ACPI_MACHINE_WIDTH 32

#define COMPILER_DEPENDENT_INT64 int64_t
#define COMPILER_DEPENDENT_UINT64 uint64_t

#include <ctype.h>
#include <stdint.h>
#include <sys/neutrino.h>

#define ACPI_USE_STANDARD_HEADERS

#define __cli() InterruptDisable();
#define __sti() InterruptEnable();
#define __cdecl

#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_NATIVE_DIVIDE

#endif /* __ACQNX_H__ */
4 changes: 4 additions & 0 deletions source/os_specific/service_layers/osbsdtbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ OslTableInitialize (
ACPI_SIZE RsdpSize;
ACPI_STATUS Status;
u_long Address = 0;
#if defined(SYSTEM_SYSCTL)
size_t Length = sizeof (Address);
#endif


/* Get main ACPI tables from memory on first invocation of this function */
Expand All @@ -480,13 +482,15 @@ OslTableInitialize (
Address = strtoul (Buffer, NULL, 0);
}
#endif
#if defined(SYSTEM_SYSCTL)
if (!Address)
{
if (sysctlbyname (SYSTEM_SYSCTL, &Address, &Length, NULL, 0) != 0)
{
Address = 0;
}
}
#endif
if (Address)
{
RsdpBase = Address;
Expand Down
2 changes: 1 addition & 1 deletion source/os_specific/service_layers/osunixmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
#define O_BINARY 0
#endif

#if defined(_DragonFly) || defined(_FreeBSD)
#if defined(_DragonFly) || defined(_FreeBSD) || defined(_QNX)
#define MMAP_FLAGS MAP_SHARED
#else
#define MMAP_FLAGS MAP_PRIVATE
Expand Down

0 comments on commit 37a1dec

Please sign in to comment.