xref: /titanic_52/usr/src/cmd/acpi/common/osl.c (revision 385cc6b4ad1792caef3f84eb61eed3f27085801f)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2016 Joyent, Inc.
14  */
15 
16 #include <stdio.h>
17 #include <stdarg.h>
18 #include "acpi.h"
19 #include "accommon.h"
20 
21 ACPI_STATUS
22 AcpiOsInitialize(void)
23 {
24 	return (AE_OK);
25 }
26 
27 /*
28  * The locking functions are no-ops because the application tools that use
29  * these are all single threaded. However, due to the common code base that we
30  * pull in from Intel, these functions are also called when the software is
31  * compiled into the kernel, where it does need to do locking.
32  */
33 ACPI_CPU_FLAGS
34 AcpiOsAcquireLock(ACPI_HANDLE Handle)
35 {
36 	return (AE_OK);
37 }
38 
39 void
40 AcpiOsReleaseLock(ACPI_HANDLE Handle, ACPI_CPU_FLAGS Flags)
41 {
42 }
43 
44 void
45 AcpiOsVprintf(const char *Format, va_list Args)
46 {
47 	vprintf(Format, Args);
48 }
49 
50 void ACPI_INTERNAL_VAR_XFACE
51 AcpiOsPrintf(const char *Format, ...)
52 {
53 	va_list ap;
54 
55 	va_start(ap, Format);
56 	AcpiOsVprintf(Format, ap);
57 	va_end(ap);
58 }
59 
60 int
61 AcpiOsWriteFile(ACPI_FILE File, void *Buffer, ACPI_SIZE Size, ACPI_SIZE Count)
62 {
63 	return (fwrite(Buffer, Size, Count, File));
64 }
65