The acpica will be integrated as module into Zephyr project for
enable acpi bus driver. This patch is for enable os specific
support layer for Zephyr.
Signed-off-by: Najumon <najumon.ba@intel.com>
ACPI_NAME_SIZE changed to ACPI_NAMESEG_SIZE
This clarifies that this is the length of an individual
nameseg, not the length of a generic namestring/namepath.
Improves understanding of the code.
ACPI_COMPARE_NAME changed to ACPI_COMPARE_NAMESEG
This clarifies (1) this is a compare on 4-byte namesegs, not
a generic compare. Improves understanding of the code.
ACPI_MOVE_NAME changed to ACPI_COPY_NAMESEG
This clarifies (1) this is a copy operation, and
(2) it operates on ACPI NameSegs.
Improves understanding of the code.
AcpiUtSafeStrncpy - copy and terminate string. Strncpy is not
guaranteed to terminate the copied string if the input is longer
than the length of the target.
/WX turns warning into fatal erros for MSVC builds. We need /WX- during
EDK2 porting to allow agile development.
Now it is time to enable /WX. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch adds AcpiOsStall() and AcpiOsSleep() support.
Currently we do not support asynchronous polling of key stroke and timer,
so AcpiOsSleep() is simply an invocation of AcpiOsStall(). Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch adds AcpiOsGetTimer() support for EFI environment.
Note that currently we don't support timezone. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch only adds stub supports for multi-threading OSLs to make
EFI ported application running.
In order to fully support acpiexec in a non multi-threading environment,
ACPICA core itself need to be upgraded to contain full asynchrnous support.
Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
ACPI spec allows to configure different 32-bit/64-bit table addresses for
DSDT and FACS. And for FACS, it's meaningful to dump both of them as they
are used to support different suspend protocols.
While:
1. on Linux, only 1 instance is supported for DSDT/FACS; and
2. on EFI, the code in OslGetTable() is buggy with special table instances,
causing endless file dump for such tables (reported by Shao Ming in link
#2).
This patch adds DSDT/FACS instance support for Linux/EFI but doesn't cover
BSD as BSD acpidump needs a full refresh. Fixed by Lv Zheng.
Link: https://bugs.acpica.org/show_bug.cgi?id=1407 [#1]
Link: https://github.com/acpica/acpica/issues/285 [#2]
Reported-by: Shao Ming <smbest163@163.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Adds the dual GNU/BSD dual license to the existing Intel license.
Provides all licensing information in each source module.
Affects all ACPICA source modules.
It's time to synchronize with Linux around trivial OS specific updates.
This patch collects all such changes. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch added two new Clibrary functions: fgetc()/fputc() for EFI
environment, they are implemented using fread()/fwrite().
Note in this patch, stdin is simply defined as NULL for EFI
environment. Its EFI support should be implemented by further patches.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
In Linux, para-virtualization implmentation hooks critical register writes
to prevent real hardware operations. This increases divergences when the
sleep registers are cracked in Linux resident ACPICA. This patch tries to
introduce a single OSL to reduce the divergences. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
The following mechanisms are OSPM specific:
1. Redirect output destination to console: no file redirection will be
needed by an in-kernel debugger, there is even no file can be accessed
when the debugger is running in the kernel mode.
2. Output command prompts: programs other than acpiexec can have different
prompt characters and the prompt characters may be implemented as a
special character sequence to form a char device IO protocol.
3. Command ready/complete handshake: OSPM debugger may wait more conditions
to implement OSPM specific semantics (for example, FIFO full/empty
conditions for O_NONBLOCK or IO open/close conditions).
Leaving such OSPM specific stuffs in the ACPICA debugger core blocks
Linux debugger IO driver implementation.
Several new OSL APIs are provided by this patch:
1. AcpiOsInitializeDebugger: initialize debugger.
2. AcpiOsTerminateDebugger: reversal of AcpiOsInitializeDebugger.
3. AcpiOsWaitCommandReady: putting debugger task into wait state when a
command is not ready. OSPMs can terminate command loop by returning
AE_CTRL_TERMINATE from this API. Normally, wait_event() or
WaitForMultipleObject() may be used to implement this API.
4. AcpiOsNotifyCommandComplete: putting user task into running state when a
command has been completed. OSPMs can terminate command loop by
returning AE_CTRL_TERMINATE from this API. Normally, wake_up() or
SetEvent() may be used to implement this API.
This patch also converts current command signaling implementation into a
generic debugger layer (osgendbg.c) to be used by the existing OSPMs or
acpiexec, in return, Linux can have chance to implement its own command
handshake mechanism. This patch also implements acpiexec batch mode in a
multi-threading mode comaptible style as a demo (this can be confirmed by
configuring acpiexec into DEBUGGER_MULTI_THREADED mode where the batch mode
is still working). Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Using of temporal file name functions can easily result in bus errors on
MacOSX. This patch implements anonymous semaphore using an automatic
increasing number. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
The following build errors can be seen for MacOSX builds:
.../osunixxf.c:882:9: error: 'sem_close' is deprecated [-Werror,-Wdeprecated-declarations]
.../acmacosx.h:122:29: note: expanded from macro 'sem_destroy'
#define sem_destroy sem_close
sem_destroy() issue is caused by the wrong order of the following lines:
#define #sem_destroy sem_close
#include <semaphore.h>
This patch fixes it by removing the buggy re-definitiion. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
The following build errors can be seen for MacOSX builds:
.../osunixxf.c:829:42: error: 'tmpnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead. [-Werror,-Wdeprecated-declarations]
tmpnam should NOT be used and provides an easy and obvious privilege
escalation attack point. There is no advantage or compatibility reason to
use this function on OS X, and it correctly throws an error if its use is
attempted. Simply replacing it with mktemp, which behaves identically to
tmpnam, only with responsible protection against interprocess attacks. It
will behave identically if given NULL, and will fail in exactly the same
way, so there is no danger in switching to this function.
It's also safely tucked away in a specific #ifdef __APPLE__ block anyway,
so the scope of this change is perfectly controlled.
Signed-off-by: metacollin <metacollin@gmail.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Implement functions to read from or write to the PCI configuration space on the
efi environment.
The implementation expects that the number of bits (Width) to be 8, 16, 32 or 64.
Add also an auxiliar function that looks for the PCI device handler correspondent
to an ACPI_PCI_ID.
Signed-off-by: Marcelo Ferreira <joaomarcelo@lesc.ufc.br>
Fix 'logical-op' warning generated by gcc 6.0 or above regarding conditionals
as "if (File == stdout || File == stderr)" since in that environment both
stdout and stderr were expanded to ST->ConOut.
This patch replace the stdout and stderr defines by global variables to avoid
that issue.
Signed-off-by: Marcelo Ferreira <joaomarcelo@lesc.ufc.br>