summaryrefslogtreecommitdiff
path: root/source/common
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2014-06-27 19:10:35 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2014-06-27 19:10:35 +0000
commite599b42ef5047e5546af949d87d2cfd2e17062b0 (patch)
treeeeef1a6644e518893667349342fa66f9f0249fec /source/common
parent6b8f78e0a6a7880856440b372097482adb326592 (diff)
Notes
Diffstat (limited to 'source/common')
-rw-r--r--source/common/ahpredef.c1
-rw-r--r--source/common/cmfsize.c20
-rw-r--r--source/common/getopt.c14
3 files changed, 17 insertions, 18 deletions
diff --git a/source/common/ahpredef.c b/source/common/ahpredef.c
index bc407b08e8f6..33c8eab43021 100644
--- a/source/common/ahpredef.c
+++ b/source/common/ahpredef.c
@@ -217,7 +217,6 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] =
AH_PREDEF ("_PR3", "Power Resources for D3hot", "Returns a list of dependent power resources to enter state D3hot"),
AH_PREDEF ("_PRE", "Power Resources for Enumeration", "Returns a list of dependent power resources to enumerate devices on a bus"),
AH_PREDEF ("_PRL", "Power Source Redundancy List", "Returns a list of power source devices in the same redundancy grouping"),
- AH_PREDEF ("_PRP", "Device Properties", "Returns a list of device property information"),
AH_PREDEF ("_PRS", "Possible Resource Settings", "Returns a list of a device's possible resource settings"),
AH_PREDEF ("_PRT", "PCI Routing Table", "Returns a list of PCI interrupt mappings"),
AH_PREDEF ("_PRW", "Power Resources for Wake", "Returns a list of dependent power resources for waking"),
diff --git a/source/common/cmfsize.c b/source/common/cmfsize.c
index c8d5a56b6f31..904d7d8da8ac 100644
--- a/source/common/cmfsize.c
+++ b/source/common/cmfsize.c
@@ -59,33 +59,34 @@
* RETURN: File Size. On error, -1 (ACPI_UINT32_MAX)
*
* DESCRIPTION: Get the size of a file. Uses seek-to-EOF. File must be open.
- * Does not disturb the current file pointer. Uses perror for
- * error messages.
+ * Does not disturb the current file pointer.
*
******************************************************************************/
UINT32
CmGetFileSize (
- FILE *File)
+ ACPI_FILE File)
{
long FileSize;
long CurrentOffset;
+ ACPI_STATUS Status;
/* Save the current file pointer, seek to EOF to obtain file size */
- CurrentOffset = ftell (File);
+ CurrentOffset = AcpiOsGetFileOffset (File);
if (CurrentOffset < 0)
{
goto OffsetError;
}
- if (fseek (File, 0, SEEK_END))
+ Status = AcpiOsSetFileOffset (File, 0, ACPI_FILE_END);
+ if (ACPI_FAILURE (Status))
{
goto SeekError;
}
- FileSize = ftell (File);
+ FileSize = AcpiOsGetFileOffset (File);
if (FileSize < 0)
{
goto OffsetError;
@@ -93,7 +94,8 @@ CmGetFileSize (
/* Restore original file pointer */
- if (fseek (File, CurrentOffset, SEEK_SET))
+ Status = AcpiOsSetFileOffset (File, CurrentOffset, ACPI_FILE_BEGIN);
+ if (ACPI_FAILURE (Status))
{
goto SeekError;
}
@@ -102,10 +104,10 @@ CmGetFileSize (
OffsetError:
- perror ("Could not get file offset");
+ AcpiLogError ("Could not get file offset");
return (ACPI_UINT32_MAX);
SeekError:
- perror ("Could not seek file");
+ AcpiLogError ("Could not set file offset");
return (ACPI_UINT32_MAX);
}
diff --git a/source/common/getopt.c b/source/common/getopt.c
index bca9a6f3e7f4..5ae1e0aa4358 100644
--- a/source/common/getopt.c
+++ b/source/common/getopt.c
@@ -51,14 +51,12 @@
* "f|" - Option has required single-char sub-options
*/
-#include <stdio.h>
-#include <string.h>
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
#define ACPI_OPTION_ERROR(msg, badchar) \
- if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
+ if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;
@@ -123,7 +121,7 @@ AcpiGetoptArgument (
* PARAMETERS: argc, argv - from main
* opts - options info list
*
- * RETURN: Option character or EOF
+ * RETURN: Option character or ACPI_OPT_END
*
* DESCRIPTION: Get the next option
*
@@ -145,12 +143,12 @@ AcpiGetopt(
argv[AcpiGbl_Optind][0] != '-' ||
argv[AcpiGbl_Optind][1] == '\0')
{
- return (EOF);
+ return (ACPI_OPT_END);
}
- else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
+ else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
{
AcpiGbl_Optind++;
- return (EOF);
+ return (ACPI_OPT_END);
}
}
@@ -161,7 +159,7 @@ AcpiGetopt(
/* Make sure that the option is legal */
if (CurrentChar == ':' ||
- (OptsPtr = strchr (opts, CurrentChar)) == NULL)
+ (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
{
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);