mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-11-04 11:29:11 +00:00 
			
		
		
		
	Standard Libraries for EDK II.
This set of three packages: AppPkg, StdLib, StdLibPrivateInternalFiles; contains the implementation of libraries based upon non-UEFI standards such as ISO/IEC-9899, the library portion of the C Language Standard, POSIX, etc. AppPkg contains applications that make use of the standard libraries defined in the StdLib Package. StdLib contains header (include) files and the implementations of the standard libraries. StdLibPrivateInternalFiles contains files for the exclusive use of the library implementations in StdLib. These files should never be directly referenced from applications or other code. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11600 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
							parent
							
								
									98790d8148
								
							
						
					
					
						commit
						2aa62f2bc9
					
				
							
								
								
									
										157
									
								
								AppPkg/AppPkg.dsc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										157
									
								
								AppPkg/AppPkg.dsc
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,157 @@
 | 
			
		||||
## @file
 | 
			
		||||
#   Intel(r) UEFI Application Development Kit for EDK II.
 | 
			
		||||
#   This package contains applications which depend upon Standard Libraries
 | 
			
		||||
#   from the StdLib package.
 | 
			
		||||
#
 | 
			
		||||
#   See the comments in the [LibraryClasses.IA32] and [BuildOptions] sections
 | 
			
		||||
#   for important information about configuring this package for your
 | 
			
		||||
#   environment.
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#   This program and the accompanying materials
 | 
			
		||||
#   are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
#   which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
#   http://opensource.org/licenses/bsd-license.
 | 
			
		||||
#
 | 
			
		||||
#   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
#   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
  PLATFORM_NAME                  = AppPkg
 | 
			
		||||
  PLATFORM_GUID                  = 0458dade-8b6e-4e45-b773-1b27cbda3e06
 | 
			
		||||
  PLATFORM_VERSION               = 0.01
 | 
			
		||||
  DSC_SPECIFICATION              = 0x00010006
 | 
			
		||||
  OUTPUT_DIRECTORY               = Build/AppPkg
 | 
			
		||||
  SUPPORTED_ARCHITECTURES        = IA32|IPF|X64
 | 
			
		||||
  BUILD_TARGETS                  = DEBUG|RELEASE
 | 
			
		||||
  SKUID_IDENTIFIER               = DEFAULT
 | 
			
		||||
 | 
			
		||||
[PcdsFeatureFlag]
 | 
			
		||||
 | 
			
		||||
[PcdsFixedAtBuild]
 | 
			
		||||
  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
 | 
			
		||||
  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000
 | 
			
		||||
 | 
			
		||||
[PcdsFixedAtBuild.IPF]
 | 
			
		||||
 | 
			
		||||
[LibraryClasses]
 | 
			
		||||
  #
 | 
			
		||||
  # Entry Point Libraries
 | 
			
		||||
  #
 | 
			
		||||
  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
 | 
			
		||||
  ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
 | 
			
		||||
  #
 | 
			
		||||
  # Common Libraries
 | 
			
		||||
  #
 | 
			
		||||
  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
 | 
			
		||||
  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
 | 
			
		||||
  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
 | 
			
		||||
  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
 | 
			
		||||
  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
 | 
			
		||||
  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
 | 
			
		||||
  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
 | 
			
		||||
  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
 | 
			
		||||
  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
 | 
			
		||||
  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
 | 
			
		||||
  PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
 | 
			
		||||
  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
 | 
			
		||||
  PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
 | 
			
		||||
  PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf
 | 
			
		||||
  SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
 | 
			
		||||
  UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
 | 
			
		||||
  HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
 | 
			
		||||
  UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
 | 
			
		||||
  PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
 | 
			
		||||
  HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
 | 
			
		||||
  ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
 | 
			
		||||
  FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
 | 
			
		||||
  SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
 | 
			
		||||
 | 
			
		||||
  #
 | 
			
		||||
  # C Standard Libraries
 | 
			
		||||
  #
 | 
			
		||||
  LibC|StdLib/LibC/LibC.inf
 | 
			
		||||
  LibStdLib|StdLib/LibC/StdLib/StdLib.inf
 | 
			
		||||
  LibString|StdLib/LibC/String/String.inf
 | 
			
		||||
  LibWchar|StdLib/LibC/Wchar/Wchar.inf
 | 
			
		||||
  LibCType|StdLib/LibC/Ctype/Ctype.inf
 | 
			
		||||
  LibTime|StdLib/LibC/Time/Time.inf
 | 
			
		||||
  LibStdio|StdLib/LibC/Stdio/Stdio.inf
 | 
			
		||||
  LibGdtoa|StdLib/LibC/gdtoa/gdtoa.inf
 | 
			
		||||
  LibLocale|StdLib/LibC/Locale/Locale.inf
 | 
			
		||||
  LibUefi|StdLib/LibC/Uefi/Uefi.inf
 | 
			
		||||
  LibMath|StdLib/LibC/Math/Math.inf
 | 
			
		||||
  LibSignal|StdLib/LibC/Signal/Signal.inf
 | 
			
		||||
  LibNetUtil|StdLib/LibC/NetUtil/NetUtil.inf
 | 
			
		||||
 | 
			
		||||
[LibraryClasses.IA32]
 | 
			
		||||
  TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf
 | 
			
		||||
  ## Comment out the above line and un-comment the line below for running under Nt32 emulation.
 | 
			
		||||
#  TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
 | 
			
		||||
 | 
			
		||||
[LibraryClasses.X64]
 | 
			
		||||
  TimerLib|PerformancePkg/Library/DxeTscTimerLib/DxeTscTimerLib.inf
 | 
			
		||||
 | 
			
		||||
[LibraryClasses.IPF]
 | 
			
		||||
  PalLib|MdePkg/Library/UefiPalLib/UefiPalLib.inf
 | 
			
		||||
  TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf
 | 
			
		||||
 | 
			
		||||
###################################################################################################
 | 
			
		||||
#
 | 
			
		||||
# Components Section - list of the modules and components that will be processed by compilation
 | 
			
		||||
#                      tools and the EDK II tools to generate PE32/PE32+/Coff image files.
 | 
			
		||||
#
 | 
			
		||||
# Note: The EDK II DSC file is not used to specify how compiled binary images get placed
 | 
			
		||||
#       into firmware volume images. This section is just a list of modules to compile from
 | 
			
		||||
#       source into UEFI-compliant binaries.
 | 
			
		||||
#       It is the FDF file that contains information on combining binary files into firmware
 | 
			
		||||
#       volume images, whose concept is beyond UEFI and is described in PI specification.
 | 
			
		||||
#       Binary modules do not need to be listed in this section, as they should be
 | 
			
		||||
#       specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi),
 | 
			
		||||
#       Logo (Logo.bmp), and etc.
 | 
			
		||||
#       There may also be modules listed in this section that are not required in the FDF file,
 | 
			
		||||
#       When a module listed here is excluded from FDF file, then UEFI-compliant binary will be
 | 
			
		||||
#       generated for it, but the binary will not be put into any firmware volume.
 | 
			
		||||
#
 | 
			
		||||
###################################################################################################
 | 
			
		||||
 | 
			
		||||
[Components]
 | 
			
		||||
# BaseLib and BaseMemoryLib need to be built with the /GL- switch when using the Microsoft
 | 
			
		||||
# tool chain.  This is required so that the library functions can be resolved during
 | 
			
		||||
# the second pass of the linker during Link-time-code-generation.
 | 
			
		||||
###
 | 
			
		||||
  MdePkg/Library/BaseLib/BaseLib.inf {
 | 
			
		||||
    <BuildOptions>
 | 
			
		||||
      MSFT:*_*_*_CC_FLAGS    = /X /Zc:wchar_t /GL-
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf {
 | 
			
		||||
    <BuildOptions>
 | 
			
		||||
      MSFT:*_*_*_CC_FLAGS    = /X /Zc:wchar_t /GL-
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#### Sample Applications.
 | 
			
		||||
  AppPkg/Applications/Hello/Hello.inf        # No LibC includes or functions.
 | 
			
		||||
  AppPkg/Applications/Main/Main.inf          # Simple invocation. No other LibC functions.
 | 
			
		||||
  AppPkg/Applications/Enquire/Enquire.inf
 | 
			
		||||
 | 
			
		||||
################################################################
 | 
			
		||||
#
 | 
			
		||||
# See the additional comments below if you plan to run applications under the
 | 
			
		||||
# Nt32 emulation environment.
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[BuildOptions]
 | 
			
		||||
  INTEL:*_*_*_CC_FLAGS      = /Qfreestanding
 | 
			
		||||
   MSFT:*_*_*_CC_FLAGS      = /X /Zc:wchar_t
 | 
			
		||||
    GCC:*_*_*_CC_FLAGS      = -ffreestanding -nostdinc -nostdlib
 | 
			
		||||
 | 
			
		||||
# The Build Options, below, are only used when building the C library
 | 
			
		||||
# to be run under the NT32 emulation.  They disable the clock() system call
 | 
			
		||||
# which is currently incompatible with the NT32 environment.
 | 
			
		||||
# Just uncomment the lines below and select the correct TimerLib instance, above.
 | 
			
		||||
 | 
			
		||||
  # INTEL:*_*_IA32_CC_FLAGS     = /D NT32dvm
 | 
			
		||||
  #  MSFT:*_*_IA32_CC_FLAGS     = /D NT32dvm
 | 
			
		||||
  #   GCC:*_*_IA32_CC_FLAGS     = -DNT32dvm
 | 
			
		||||
							
								
								
									
										3377
									
								
								AppPkg/Applications/Enquire/Enquire.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3377
									
								
								AppPkg/Applications/Enquire/Enquire.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										53
									
								
								AppPkg/Applications/Enquire/Enquire.inf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								AppPkg/Applications/Enquire/Enquire.inf
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  Enquire application for system integer and floating point characteristics
 | 
			
		||||
#  enquiry.
 | 
			
		||||
#
 | 
			
		||||
#   Due to the level of hardware introspection, this application MUST be built
 | 
			
		||||
#   with optimizations disabled.
 | 
			
		||||
#
 | 
			
		||||
# COPYRIGHT(c) 1993-9 Steven Pemberton, CWI. All rights reserved.
 | 
			
		||||
# NOTE: Improvements gratefully received. Please mention the version.
 | 
			
		||||
#       "http://www.cwi.nl/~steven/enquire.html"
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  This program and the accompanying materials
 | 
			
		||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
#  which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
#  http://opensource.org/licenses/bsd-license.
 | 
			
		||||
#
 | 
			
		||||
#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
  INF_VERSION                    = 0x00010006
 | 
			
		||||
  BASE_NAME                      = Enquire
 | 
			
		||||
  FILE_GUID                      = 42f58b27-5dc3-4fa7-844d-5a7dbff06432
 | 
			
		||||
  MODULE_TYPE                    = UEFI_APPLICATION
 | 
			
		||||
  VERSION_STRING                 = 0.1
 | 
			
		||||
  ENTRY_POINT                    = ShellCEntryLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#  VALID_ARCHITECTURES           = IA32 X64 IPF
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[Sources]
 | 
			
		||||
  Enquire.c
 | 
			
		||||
 | 
			
		||||
[Packages]
 | 
			
		||||
  StdLib/StdLib.dec
 | 
			
		||||
  MdePkg/MdePkg.dec
 | 
			
		||||
 | 
			
		||||
[LibraryClasses]
 | 
			
		||||
  UefiLib
 | 
			
		||||
  LibC
 | 
			
		||||
  LibString
 | 
			
		||||
  LibStdio
 | 
			
		||||
  LibGdtoa
 | 
			
		||||
  LibWchar
 | 
			
		||||
 | 
			
		||||
[BuildOptions]
 | 
			
		||||
  INTEL:*_*_*_CC_FLAGS    = /Qdiag-disable:181,186
 | 
			
		||||
   MSFT:*_*_*_CC_FLAGS    = /Od
 | 
			
		||||
    GCC:*_*_*_CC_FLAGS    = -O0 -Wno-unused-variable
 | 
			
		||||
							
								
								
									
										37
									
								
								AppPkg/Applications/Hello/Hello.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								AppPkg/Applications/Hello/Hello.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    A simple, basic, EDK II native, "hello" application to verify that
 | 
			
		||||
    we can build applications without LibC.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials
 | 
			
		||||
    are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
    which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
**/
 | 
			
		||||
#include  <Uefi.h>
 | 
			
		||||
#include  <Library/UefiLib.h>
 | 
			
		||||
#include  <Library/ShellCEntryLib.h>
 | 
			
		||||
 | 
			
		||||
/***
 | 
			
		||||
  Print a welcoming message.
 | 
			
		||||
 | 
			
		||||
  Establishes the main structure of the application.
 | 
			
		||||
 | 
			
		||||
  @retval  0         The application exited normally.
 | 
			
		||||
  @retval  Other     An error occurred.
 | 
			
		||||
***/
 | 
			
		||||
INTN
 | 
			
		||||
EFIAPI
 | 
			
		||||
ShellAppMain (
 | 
			
		||||
  IN UINTN Argc,
 | 
			
		||||
  IN CHAR16 **Argv
 | 
			
		||||
  )
 | 
			
		||||
{
 | 
			
		||||
  Print(L"Hello there fellow Programmer.\n");
 | 
			
		||||
  Print(L"Welcome to the world of EDK II.\n");
 | 
			
		||||
 | 
			
		||||
  return(0);
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										36
									
								
								AppPkg/Applications/Hello/Hello.inf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								AppPkg/Applications/Hello/Hello.inf
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
			
		||||
## @file
 | 
			
		||||
#  A simple, basic, EDK II native, "hello" application.
 | 
			
		||||
#
 | 
			
		||||
#   Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#   This program and the accompanying materials
 | 
			
		||||
#   are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
#   which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
#   http://opensource.org/licenses/bsd-license.
 | 
			
		||||
#
 | 
			
		||||
#   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
#   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
#
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
  INF_VERSION                    = 0x00010006
 | 
			
		||||
  BASE_NAME                      = Hello
 | 
			
		||||
  FILE_GUID                      = a912f198-7f0e-4803-b908-b757b806ec83
 | 
			
		||||
  MODULE_TYPE                    = UEFI_APPLICATION
 | 
			
		||||
  VERSION_STRING                 = 0.1
 | 
			
		||||
  ENTRY_POINT                    = ShellCEntryLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#  VALID_ARCHITECTURES           = IA32 X64 IPF
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[Sources]
 | 
			
		||||
  Hello.c
 | 
			
		||||
 | 
			
		||||
[Packages]
 | 
			
		||||
  MdePkg/MdePkg.dec
 | 
			
		||||
  ShellPkg/ShellPkg.dec
 | 
			
		||||
 | 
			
		||||
[LibraryClasses]
 | 
			
		||||
  UefiLib
 | 
			
		||||
  ShellCEntryLib
 | 
			
		||||
							
								
								
									
										46
									
								
								AppPkg/Applications/Main/Main.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								AppPkg/Applications/Main/Main.c
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,46 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    A simple, basic, application showing how the Hello application could be
 | 
			
		||||
    built using the "Standard C Libraries" from StdLib.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials
 | 
			
		||||
    are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
    which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
**/
 | 
			
		||||
//#include  <Uefi.h>
 | 
			
		||||
//#include  <Library/UefiLib.h>
 | 
			
		||||
//#include  <Library/ShellCEntryLib.h>
 | 
			
		||||
 | 
			
		||||
#include  <stdio.h>
 | 
			
		||||
 | 
			
		||||
/***
 | 
			
		||||
  Demonstrates basic workings of the main() function by displaying a
 | 
			
		||||
  welcoming message.
 | 
			
		||||
 | 
			
		||||
  Note that the UEFI command line is composed of 16-bit UCS2 wide characters.
 | 
			
		||||
  The easiest way to access the command line parameters is to cast Argv as:
 | 
			
		||||
      wchar_t **wArgv = (wchar_t **)Argv;
 | 
			
		||||
 | 
			
		||||
  @param[in]  Argc    Number of argument tokens pointed to by Argv.
 | 
			
		||||
  @param[in]  Argv    Array of Argc pointers to command line tokens.
 | 
			
		||||
 | 
			
		||||
  @retval  0         The application exited normally.
 | 
			
		||||
  @retval  Other     An error occurred.
 | 
			
		||||
***/
 | 
			
		||||
int
 | 
			
		||||
EFIAPI
 | 
			
		||||
main (
 | 
			
		||||
  IN int Argc,
 | 
			
		||||
  IN char **Argv
 | 
			
		||||
  )
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
  puts("Hello there fellow Programmer.");
 | 
			
		||||
  puts("Welcome to the world of EDK II.");
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										42
									
								
								AppPkg/Applications/Main/Main.inf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								AppPkg/Applications/Main/Main.inf
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
			
		||||
## @file
 | 
			
		||||
#   A simple, basic, application showing how the Hello application could be
 | 
			
		||||
#   built using the "Standard C Libraries" from StdLib.
 | 
			
		||||
#
 | 
			
		||||
#  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
#  This program and the accompanying materials
 | 
			
		||||
#  are licensed and made available under the terms and conditions of the BSD License
 | 
			
		||||
#  which accompanies this distribution. The full text of the license may be found at
 | 
			
		||||
#  http://opensource.org/licenses/bsd-license.
 | 
			
		||||
#
 | 
			
		||||
#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
[Defines]
 | 
			
		||||
  INF_VERSION                    = 0x00010006
 | 
			
		||||
  BASE_NAME                      = Main
 | 
			
		||||
  FILE_GUID                      = 4ea97c46-7491-4dfd-b442-747010f3ce5f
 | 
			
		||||
  MODULE_TYPE                    = UEFI_APPLICATION
 | 
			
		||||
  VERSION_STRING                 = 0.1
 | 
			
		||||
  ENTRY_POINT                    = ShellCEntryLib
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
#  VALID_ARCHITECTURES           = IA32 X64 IPF
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
[Sources]
 | 
			
		||||
  Main.c
 | 
			
		||||
 | 
			
		||||
[Packages]
 | 
			
		||||
  StdLib/StdLib.dec
 | 
			
		||||
  MdePkg/MdePkg.dec
 | 
			
		||||
  ShellPkg/ShellPkg.dec
 | 
			
		||||
 | 
			
		||||
[LibraryClasses]
 | 
			
		||||
  LibC
 | 
			
		||||
  LibStdio
 | 
			
		||||
#  UefiLib
 | 
			
		||||
#  ShellCEntryLib
 | 
			
		||||
 | 
			
		||||
[BuildOptions]
 | 
			
		||||
  MSFT:*_*_IA32_CC_FLAGS  = /Oi-
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								AppPkg/ReadMe.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								AppPkg/ReadMe.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										18
									
								
								StdLib/Include/Arm/machine/_math.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								StdLib/Include/Arm/machine/_math.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials are licensed and made available under
 | 
			
		||||
the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
The full text of the license may be found at
 | 
			
		||||
http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHINE_MATH_H
 | 
			
		||||
#define _MACHINE_MATH_H
 | 
			
		||||
 | 
			
		||||
//#define __HUGE_VAL  ???????????.?????????????
 | 
			
		||||
 | 
			
		||||
#endif    /* _MACHINE_MATH_H */
 | 
			
		||||
							
								
								
									
										106
									
								
								StdLib/Include/Arm/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								StdLib/Include/Arm/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,106 @@
 | 
			
		||||
/*	$NetBSD: ansi.h,v 1.7 2006/10/04 13:51:59 tnozaki Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1990, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	from: @(#)ansi.h	8.2 (Berkeley) 1/4/94
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_ANSI_H_
 | 
			
		||||
#define	_ANSI_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/cdefs.h>
 | 
			
		||||
 | 
			
		||||
#include <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types which are fundamental to the implementation and may appear in
 | 
			
		||||
 * more than one standard header are defined here.  Standard headers
 | 
			
		||||
 * then use:
 | 
			
		||||
 *	#ifdef	_BSD_SIZE_T_
 | 
			
		||||
 *	typedef	_BSD_SIZE_T_ size_t;
 | 
			
		||||
 *	#undef	_BSD_SIZE_T_
 | 
			
		||||
 *	#endif
 | 
			
		||||
 */
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define	_BSD_CLOCK_T_		unsigned int	/* clock() */
 | 
			
		||||
#define	_BSD_PTRDIFF_T_		long int	/* ptr1 - ptr2 */
 | 
			
		||||
#define	_BSD_SIZE_T_		unsigned long int /* sizeof() */
 | 
			
		||||
#define	_BSD_SSIZE_T_		long int	/* byte count or error */
 | 
			
		||||
#define	_BSD_TIME_T_		int		/* time() */
 | 
			
		||||
#else
 | 
			
		||||
#define	_BSD_CLOCK_T_		unsigned long	/* clock() */
 | 
			
		||||
#define	_BSD_PTRDIFF_T_		int		/* ptr1 - ptr2 */
 | 
			
		||||
#define	_BSD_SIZE_T_		unsigned int	/* sizeof() */
 | 
			
		||||
#define	_BSD_SSIZE_T_		int		/* byte count or error */
 | 
			
		||||
#define	_BSD_TIME_T_		long		/* time() */
 | 
			
		||||
#endif
 | 
			
		||||
#if __GNUC_PREREQ__(2, 96)
 | 
			
		||||
#define	_BSD_VA_LIST_		__builtin_va_list /* GCC built-in type */
 | 
			
		||||
#else
 | 
			
		||||
#define	_BSD_VA_LIST_		char *		/* va_list */
 | 
			
		||||
#endif
 | 
			
		||||
#define	_BSD_CLOCKID_T_		int		/* clockid_t */
 | 
			
		||||
#define	_BSD_TIMER_T_		int		/* timer_t */
 | 
			
		||||
#define	_BSD_SUSECONDS_T_	int		/* suseconds_t */
 | 
			
		||||
#define	_BSD_USECONDS_T_	unsigned int	/* useconds_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
 | 
			
		||||
 * be instantiated outside of lib/libc/locale.  use wchar_t.
 | 
			
		||||
 *
 | 
			
		||||
 * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
 | 
			
		||||
 * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
 | 
			
		||||
 * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
 | 
			
		||||
 * it looks like 10646 will be a 31 bit standard.  This means that if your
 | 
			
		||||
 * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
 | 
			
		||||
 * chosen over a long is that the is*() and to*() routines take ints (says
 | 
			
		||||
 * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you
 | 
			
		||||
 * lose a bit of ANSI conformance, but your programs will still work.
 | 
			
		||||
 *    
 | 
			
		||||
 * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
 | 
			
		||||
 * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
 | 
			
		||||
 * defined for ctype.h.
 | 
			
		||||
 */
 | 
			
		||||
#define	_BSD_WCHAR_T_		int		/* wchar_t */
 | 
			
		||||
#define	_BSD_WINT_T_		int		/* wint_t */
 | 
			
		||||
#define	_BSD_RUNE_T_		int		/* rune_t */
 | 
			
		||||
#define _BSD_WCTRANS_T_		void *		/* wctrans_t */
 | 
			
		||||
#define _BSD_WCTYPE_T_		void *		/* wctype_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * mbstate_t is an opaque object to keep conversion state, during multibyte
 | 
			
		||||
 * stream conversions.  The content must not be referenced by user programs.
 | 
			
		||||
 */
 | 
			
		||||
typedef union {
 | 
			
		||||
	__int64_t __mbstateL;	/* for alignment */
 | 
			
		||||
	char __mbstate8[128];
 | 
			
		||||
} __mbstate_t;
 | 
			
		||||
#define	_BSD_MBSTATE_T_		__mbstate_t	/* mbstate_t */
 | 
			
		||||
 | 
			
		||||
#endif	/* _ANSI_H_ */
 | 
			
		||||
							
								
								
									
										167
									
								
								StdLib/Include/Arm/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										167
									
								
								StdLib/Include/Arm/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,167 @@
 | 
			
		||||
/*	$NetBSD: asm.h,v 1.8 2006/01/20 22:02:40 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	from: @(#)asm.h	5.5 (Berkeley) 5/7/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM32_ASM_H_
 | 
			
		||||
#define _ARM32_ASM_H_
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
# define _C_LABEL(x)	x
 | 
			
		||||
#else
 | 
			
		||||
# ifdef __STDC__
 | 
			
		||||
#  define _C_LABEL(x)	_ ## x
 | 
			
		||||
# else
 | 
			
		||||
#  define _C_LABEL(x)	_/**/x
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#define	_ASM_LABEL(x)	x
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
# define __CONCAT(x,y)	x ## y
 | 
			
		||||
# define __STRING(x)	#x
 | 
			
		||||
#else
 | 
			
		||||
# define __CONCAT(x,y)	x/**/y
 | 
			
		||||
# define __STRING(x)	"x"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef _ALIGN_TEXT
 | 
			
		||||
# define _ALIGN_TEXT .align 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * gas/arm uses @ as a single comment character and thus cannot be used here
 | 
			
		||||
 * Instead it recognised the # instead of an @ symbols in .type directives
 | 
			
		||||
 * We define a couple of macros so that assembly code will not be dependant
 | 
			
		||||
 * on one or the other.
 | 
			
		||||
 */
 | 
			
		||||
#define _ASM_TYPE_FUNCTION	#function
 | 
			
		||||
#define _ASM_TYPE_OBJECT	#object
 | 
			
		||||
#define _ENTRY(x) \
 | 
			
		||||
	.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x:
 | 
			
		||||
 | 
			
		||||
#ifdef GPROF
 | 
			
		||||
# ifdef __ELF__
 | 
			
		||||
#  define _PROF_PROLOGUE	\
 | 
			
		||||
	mov ip, lr; bl __mcount
 | 
			
		||||
# else
 | 
			
		||||
#  define _PROF_PROLOGUE	\
 | 
			
		||||
	mov ip,lr; bl mcount
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
# define _PROF_PROLOGUE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
#define	ENTRY_NP(y)	_ENTRY(_C_LABEL(y))
 | 
			
		||||
#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
#define	ASENTRY_NP(y)	_ENTRY(_ASM_LABEL(y))
 | 
			
		||||
 | 
			
		||||
#define	ASMSTR		.asciz
 | 
			
		||||
 | 
			
		||||
#if defined(__ELF__) && defined(PIC)
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	PIC_SYM(x,y)	x ## ( ## y ## )
 | 
			
		||||
#else
 | 
			
		||||
#define	PIC_SYM(x,y)	x/**/(/**/y/**/)
 | 
			
		||||
#endif
 | 
			
		||||
#else
 | 
			
		||||
#define	PIC_SYM(x,y)	x
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define RCSID(x)	.section ".ident"; .asciz x
 | 
			
		||||
#else
 | 
			
		||||
#define RCSID(x)	.text; .asciz x
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define	WEAK_ALIAS(alias,sym)						\
 | 
			
		||||
	.weak alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * STRONG_ALIAS: create a strong alias.
 | 
			
		||||
 */
 | 
			
		||||
#define STRONG_ALIAS(alias,sym)						\
 | 
			
		||||
	.globl alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg ## ,30,0,0,0 ;					\
 | 
			
		||||
	.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
 | 
			
		||||
#elif defined(__ELF__)
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg,30,0,0,0 ;						\
 | 
			
		||||
	.stabs __STRING(sym),1,0,0,0
 | 
			
		||||
#else
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg,30,0,0,0 ;						\
 | 
			
		||||
	.stabs __STRING(_/**/sym),1,0,0,0
 | 
			
		||||
#endif /* __STDC__ */
 | 
			
		||||
 | 
			
		||||
#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__)
 | 
			
		||||
#define _ARM_ARCH_6
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5__) || \
 | 
			
		||||
    defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5TE__) || \
 | 
			
		||||
    defined (__ARM_ARCH_5TEJ__)
 | 
			
		||||
#define _ARM_ARCH_5
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
 | 
			
		||||
#define _ARM_ARCH_4T
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if defined (_ARM_ARCH_4T)
 | 
			
		||||
# define RET	bx	lr
 | 
			
		||||
# ifdef __STDC__
 | 
			
		||||
#  define RETc(c) bx##c	lr
 | 
			
		||||
# else
 | 
			
		||||
#  define RETc(c) bx/**/c	lr
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
# define RET	mov	pc, lr
 | 
			
		||||
# ifdef __STDC__
 | 
			
		||||
#  define RETc(c) mov##c	pc, lr
 | 
			
		||||
# else
 | 
			
		||||
#  define RETc(c) mov/**/c	pc, lr
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_ARM_ASM_H_ */
 | 
			
		||||
							
								
								
									
										102
									
								
								StdLib/Include/Arm/machine/atomic.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								StdLib/Include/Arm/machine/atomic.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,102 @@
 | 
			
		||||
/* $NetBSD: atomic.h,v 1.5 2005/12/28 19:09:29 perry Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (C) 1994-1997 Mark Brinicombe
 | 
			
		||||
 * Copyright (C) 1994 Brini
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software written for Brini by Mark Brinicombe
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by Brini.
 | 
			
		||||
 * 4. The name of Brini may not be used to endorse or promote products
 | 
			
		||||
 *    derived from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL BRINI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 | 
			
		||||
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 | 
			
		||||
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 | 
			
		||||
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 | 
			
		||||
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 | 
			
		||||
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 | 
			
		||||
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_ARM_ATOMIC_H_
 | 
			
		||||
#define	_ARM_ATOMIC_H_
 | 
			
		||||
 | 
			
		||||
#ifndef ATOMIC_SET_BIT_NONINLINE_REQUIRED
 | 
			
		||||
 | 
			
		||||
#if defined(__PROG26) || defined(ATOMIC_SET_BIT_NOINLINE)
 | 
			
		||||
#define	ATOMIC_SET_BIT_NONINLINE_REQUIRED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* ATOMIC_SET_BIT_NONINLINE_REQUIRED */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <arm/armreg.h>			/* I32_bit */
 | 
			
		||||
 | 
			
		||||
#ifdef ATOMIC_SET_BIT_NONINLINE_REQUIRED
 | 
			
		||||
void atomic_set_bit( u_int *, u_int );
 | 
			
		||||
void atomic_clear_bit( u_int *, u_int );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __PROG32
 | 
			
		||||
#define __with_interrupts_disabled(expr) \
 | 
			
		||||
	do {						\
 | 
			
		||||
		u_int cpsr_save, tmp;			\
 | 
			
		||||
							\
 | 
			
		||||
		__asm volatile(			\
 | 
			
		||||
			"mrs  %0, cpsr;"		\
 | 
			
		||||
			"orr  %1, %0, %2;"		\
 | 
			
		||||
			"msr  cpsr_all, %1;"		\
 | 
			
		||||
			: "=r" (cpsr_save), "=r" (tmp)	\
 | 
			
		||||
			: "I" (I32_bit)		\
 | 
			
		||||
		        : "cc" );		\
 | 
			
		||||
		(expr);				\
 | 
			
		||||
		 __asm volatile(		\
 | 
			
		||||
			"msr  cpsr_all, %0"	\
 | 
			
		||||
			: /* no output */	\
 | 
			
		||||
			: "r" (cpsr_save)	\
 | 
			
		||||
			: "cc" );		\
 | 
			
		||||
	} while(0)
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
inline_atomic_set_bit( u_int *address, u_int setmask )
 | 
			
		||||
{
 | 
			
		||||
	__with_interrupts_disabled( *address |= setmask );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
inline_atomic_clear_bit( u_int *address, u_int clearmask )
 | 
			
		||||
{
 | 
			
		||||
	__with_interrupts_disabled( *address &= ~clearmask );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if !defined(ATOMIC_SET_BIT_NOINLINE)
 | 
			
		||||
 | 
			
		||||
#define atomic_set_bit(a,m)   inline_atomic_set_bit(a,m)
 | 
			
		||||
#define atomic_clear_bit(a,m) inline_atomic_clear_bit(a,m)
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __PROG32 */
 | 
			
		||||
 | 
			
		||||
#undef __with_interrupts_disabled
 | 
			
		||||
 | 
			
		||||
#endif /* _LOCORE */
 | 
			
		||||
#endif /* _ARM_ATOMIC_H_ */
 | 
			
		||||
							
								
								
									
										558
									
								
								StdLib/Include/Arm/machine/cpufunc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										558
									
								
								StdLib/Include/Arm/machine/cpufunc.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,558 @@
 | 
			
		||||
/*	$NetBSD: cpufunc.h,v 1.37.24.1 2007/02/21 18:36:02 snj Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1997 Mark Brinicombe.
 | 
			
		||||
 * Copyright (c) 1997 Causality Limited
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by Causality Limited.
 | 
			
		||||
 * 4. The name of Causality Limited may not be used to endorse or promote
 | 
			
		||||
 *    products derived from this software without specific prior written
 | 
			
		||||
 *    permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY CAUSALITY LIMITED ``AS IS'' AND ANY EXPRESS
 | 
			
		||||
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 | 
			
		||||
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 | 
			
		||||
 * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED BE LIABLE FOR ANY DIRECT,
 | 
			
		||||
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
			
		||||
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 | 
			
		||||
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * RiscBSD kernel project
 | 
			
		||||
 *
 | 
			
		||||
 * cpufunc.h
 | 
			
		||||
 *
 | 
			
		||||
 * Prototypes for cpu, mmu and tlb related functions.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM32_CPUFUNC_H_
 | 
			
		||||
#define _ARM32_CPUFUNC_H_
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
#include <arm/cpuconf.h>
 | 
			
		||||
 | 
			
		||||
struct cpu_functions {
 | 
			
		||||
 | 
			
		||||
	/* CPU functions */
 | 
			
		||||
 | 
			
		||||
	u_int	(*cf_id)		__P((void));
 | 
			
		||||
	void	(*cf_cpwait)		__P((void));
 | 
			
		||||
 | 
			
		||||
	/* MMU functions */
 | 
			
		||||
 | 
			
		||||
	u_int	(*cf_control)		__P((u_int, u_int));
 | 
			
		||||
	void	(*cf_domains)		__P((u_int));
 | 
			
		||||
	void	(*cf_setttb)		__P((u_int));
 | 
			
		||||
	u_int	(*cf_faultstatus)	__P((void));
 | 
			
		||||
	u_int	(*cf_faultaddress)	__P((void));
 | 
			
		||||
 | 
			
		||||
	/* TLB functions */
 | 
			
		||||
 | 
			
		||||
	void	(*cf_tlb_flushID)	__P((void));
 | 
			
		||||
	void	(*cf_tlb_flushID_SE)	__P((u_int));
 | 
			
		||||
	void	(*cf_tlb_flushI)	__P((void));
 | 
			
		||||
	void	(*cf_tlb_flushI_SE)	__P((u_int));
 | 
			
		||||
	void	(*cf_tlb_flushD)	__P((void));
 | 
			
		||||
	void	(*cf_tlb_flushD_SE)	__P((u_int));
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Cache operations:
 | 
			
		||||
	 *
 | 
			
		||||
	 * We define the following primitives:
 | 
			
		||||
	 *
 | 
			
		||||
	 *	icache_sync_all		Synchronize I-cache
 | 
			
		||||
	 *	icache_sync_range	Synchronize I-cache range
 | 
			
		||||
	 *
 | 
			
		||||
	 *	dcache_wbinv_all	Write-back and Invalidate D-cache
 | 
			
		||||
	 *	dcache_wbinv_range	Write-back and Invalidate D-cache range
 | 
			
		||||
	 *	dcache_inv_range	Invalidate D-cache range
 | 
			
		||||
	 *	dcache_wb_range		Write-back D-cache range
 | 
			
		||||
	 *
 | 
			
		||||
	 *	idcache_wbinv_all	Write-back and Invalidate D-cache,
 | 
			
		||||
	 *				Invalidate I-cache
 | 
			
		||||
	 *	idcache_wbinv_range	Write-back and Invalidate D-cache,
 | 
			
		||||
	 *				Invalidate I-cache range
 | 
			
		||||
	 *
 | 
			
		||||
	 * Note that the ARM term for "write-back" is "clean".  We use
 | 
			
		||||
	 * the term "write-back" since it's a more common way to describe
 | 
			
		||||
	 * the operation.
 | 
			
		||||
	 *
 | 
			
		||||
	 * There are some rules that must be followed:
 | 
			
		||||
	 *
 | 
			
		||||
	 *	I-cache Synch (all or range):
 | 
			
		||||
	 *		The goal is to synchronize the instruction stream,
 | 
			
		||||
	 *		so you may beed to write-back dirty D-cache blocks
 | 
			
		||||
	 *		first.  If a range is requested, and you can't
 | 
			
		||||
	 *		synchronize just a range, you have to hit the whole
 | 
			
		||||
	 *		thing.
 | 
			
		||||
	 *
 | 
			
		||||
	 *	D-cache Write-Back and Invalidate range:
 | 
			
		||||
	 *		If you can't WB-Inv a range, you must WB-Inv the
 | 
			
		||||
	 *		entire D-cache.
 | 
			
		||||
	 *
 | 
			
		||||
	 *	D-cache Invalidate:
 | 
			
		||||
	 *		If you can't Inv the D-cache, you must Write-Back
 | 
			
		||||
	 *		and Invalidate.  Code that uses this operation
 | 
			
		||||
	 *		MUST NOT assume that the D-cache will not be written
 | 
			
		||||
	 *		back to memory.
 | 
			
		||||
	 *
 | 
			
		||||
	 *	D-cache Write-Back:
 | 
			
		||||
	 *		If you can't Write-back without doing an Inv,
 | 
			
		||||
	 *		that's fine.  Then treat this as a WB-Inv.
 | 
			
		||||
	 *		Skipping the invalidate is merely an optimization.
 | 
			
		||||
	 *
 | 
			
		||||
	 *	All operations:
 | 
			
		||||
	 *		Valid virtual addresses must be passed to each
 | 
			
		||||
	 *		cache operation.
 | 
			
		||||
	 */
 | 
			
		||||
	void	(*cf_icache_sync_all)	__P((void));
 | 
			
		||||
	void	(*cf_icache_sync_range)	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
	void	(*cf_dcache_wbinv_all)	__P((void));
 | 
			
		||||
	void	(*cf_dcache_wbinv_range) __P((vaddr_t, vsize_t));
 | 
			
		||||
	void	(*cf_dcache_inv_range)	__P((vaddr_t, vsize_t));
 | 
			
		||||
	void	(*cf_dcache_wb_range)	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
	void	(*cf_idcache_wbinv_all)	__P((void));
 | 
			
		||||
	void	(*cf_idcache_wbinv_range) __P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
	/* Other functions */
 | 
			
		||||
 | 
			
		||||
	void	(*cf_flush_prefetchbuf)	__P((void));
 | 
			
		||||
	void	(*cf_drain_writebuf)	__P((void));
 | 
			
		||||
	void	(*cf_flush_brnchtgt_C)	__P((void));
 | 
			
		||||
	void	(*cf_flush_brnchtgt_E)	__P((u_int));
 | 
			
		||||
 | 
			
		||||
	void	(*cf_sleep)		__P((int mode));
 | 
			
		||||
 | 
			
		||||
	/* Soft functions */
 | 
			
		||||
 | 
			
		||||
	int	(*cf_dataabt_fixup)	__P((void *));
 | 
			
		||||
	int	(*cf_prefetchabt_fixup)	__P((void *));
 | 
			
		||||
 | 
			
		||||
	void	(*cf_context_switch)	__P((void));
 | 
			
		||||
 | 
			
		||||
	void	(*cf_setup)		__P((char *));
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern struct cpu_functions cpufuncs;
 | 
			
		||||
extern u_int cputype;
 | 
			
		||||
 | 
			
		||||
#define cpu_id()		cpufuncs.cf_id()
 | 
			
		||||
#define	cpu_cpwait()		cpufuncs.cf_cpwait()
 | 
			
		||||
 | 
			
		||||
#define cpu_control(c, e)	cpufuncs.cf_control(c, e)
 | 
			
		||||
#define cpu_domains(d)		cpufuncs.cf_domains(d)
 | 
			
		||||
#define cpu_setttb(t)		cpufuncs.cf_setttb(t)
 | 
			
		||||
#define cpu_faultstatus()	cpufuncs.cf_faultstatus()
 | 
			
		||||
#define cpu_faultaddress()	cpufuncs.cf_faultaddress()
 | 
			
		||||
 | 
			
		||||
#define	cpu_tlb_flushID()	cpufuncs.cf_tlb_flushID()
 | 
			
		||||
#define	cpu_tlb_flushID_SE(e)	cpufuncs.cf_tlb_flushID_SE(e)
 | 
			
		||||
#define	cpu_tlb_flushI()	cpufuncs.cf_tlb_flushI()
 | 
			
		||||
#define	cpu_tlb_flushI_SE(e)	cpufuncs.cf_tlb_flushI_SE(e)
 | 
			
		||||
#define	cpu_tlb_flushD()	cpufuncs.cf_tlb_flushD()
 | 
			
		||||
#define	cpu_tlb_flushD_SE(e)	cpufuncs.cf_tlb_flushD_SE(e)
 | 
			
		||||
 | 
			
		||||
#define	cpu_icache_sync_all()	cpufuncs.cf_icache_sync_all()
 | 
			
		||||
#define	cpu_icache_sync_range(a, s) cpufuncs.cf_icache_sync_range((a), (s))
 | 
			
		||||
 | 
			
		||||
#define	cpu_dcache_wbinv_all()	cpufuncs.cf_dcache_wbinv_all()
 | 
			
		||||
#define	cpu_dcache_wbinv_range(a, s) cpufuncs.cf_dcache_wbinv_range((a), (s))
 | 
			
		||||
#define	cpu_dcache_inv_range(a, s) cpufuncs.cf_dcache_inv_range((a), (s))
 | 
			
		||||
#define	cpu_dcache_wb_range(a, s) cpufuncs.cf_dcache_wb_range((a), (s))
 | 
			
		||||
 | 
			
		||||
#define	cpu_idcache_wbinv_all()	cpufuncs.cf_idcache_wbinv_all()
 | 
			
		||||
#define	cpu_idcache_wbinv_range(a, s) cpufuncs.cf_idcache_wbinv_range((a), (s))
 | 
			
		||||
 | 
			
		||||
#define	cpu_flush_prefetchbuf()	cpufuncs.cf_flush_prefetchbuf()
 | 
			
		||||
#define	cpu_drain_writebuf()	cpufuncs.cf_drain_writebuf()
 | 
			
		||||
#define	cpu_flush_brnchtgt_C()	cpufuncs.cf_flush_brnchtgt_C()
 | 
			
		||||
#define	cpu_flush_brnchtgt_E(e)	cpufuncs.cf_flush_brnchtgt_E(e)
 | 
			
		||||
 | 
			
		||||
#define cpu_sleep(m)		cpufuncs.cf_sleep(m)
 | 
			
		||||
 | 
			
		||||
#define cpu_dataabt_fixup(a)		cpufuncs.cf_dataabt_fixup(a)
 | 
			
		||||
#define cpu_prefetchabt_fixup(a)	cpufuncs.cf_prefetchabt_fixup(a)
 | 
			
		||||
#define ABORT_FIXUP_OK		0	/* fixup succeeded */
 | 
			
		||||
#define ABORT_FIXUP_FAILED	1	/* fixup failed */
 | 
			
		||||
#define ABORT_FIXUP_RETURN	2	/* abort handler should return */
 | 
			
		||||
 | 
			
		||||
#define cpu_setup(a)			cpufuncs.cf_setup(a)
 | 
			
		||||
 | 
			
		||||
int	set_cpufuncs		__P((void));
 | 
			
		||||
#define ARCHITECTURE_NOT_PRESENT	1	/* known but not configured */
 | 
			
		||||
#define ARCHITECTURE_NOT_SUPPORTED	2	/* not known */
 | 
			
		||||
 | 
			
		||||
void	cpufunc_nullop		__P((void));
 | 
			
		||||
int	cpufunc_null_fixup	__P((void *));
 | 
			
		||||
int	early_abort_fixup	__P((void *));
 | 
			
		||||
int	late_abort_fixup	__P((void *));
 | 
			
		||||
u_int	cpufunc_id		__P((void));
 | 
			
		||||
u_int	cpufunc_control		__P((u_int, u_int));
 | 
			
		||||
void	cpufunc_domains		__P((u_int));
 | 
			
		||||
u_int	cpufunc_faultstatus	__P((void));
 | 
			
		||||
u_int	cpufunc_faultaddress	__P((void));
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM3
 | 
			
		||||
u_int	arm3_control		__P((u_int, u_int));
 | 
			
		||||
void	arm3_cache_flush	__P((void));
 | 
			
		||||
#endif	/* CPU_ARM3 */
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_ARM6) || defined(CPU_ARM7)
 | 
			
		||||
void	arm67_setttb		__P((u_int));
 | 
			
		||||
void	arm67_tlb_flush		__P((void));
 | 
			
		||||
void	arm67_tlb_purge		__P((u_int));
 | 
			
		||||
void	arm67_cache_flush	__P((void));
 | 
			
		||||
void	arm67_context_switch	__P((void));
 | 
			
		||||
#endif	/* CPU_ARM6 || CPU_ARM7 */
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM6
 | 
			
		||||
void	arm6_setup		__P((char *));
 | 
			
		||||
#endif	/* CPU_ARM6 */
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM7
 | 
			
		||||
void	arm7_setup		__P((char *));
 | 
			
		||||
#endif	/* CPU_ARM7 */
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM7TDMI
 | 
			
		||||
int	arm7_dataabt_fixup	__P((void *));
 | 
			
		||||
void	arm7tdmi_setup		__P((char *));
 | 
			
		||||
void	arm7tdmi_setttb		__P((u_int));
 | 
			
		||||
void	arm7tdmi_tlb_flushID	__P((void));
 | 
			
		||||
void	arm7tdmi_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
void	arm7tdmi_cache_flushID	__P((void));
 | 
			
		||||
void	arm7tdmi_context_switch	__P((void));
 | 
			
		||||
#endif /* CPU_ARM7TDMI */
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM8
 | 
			
		||||
void	arm8_setttb		__P((u_int));
 | 
			
		||||
void	arm8_tlb_flushID	__P((void));
 | 
			
		||||
void	arm8_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
void	arm8_cache_flushID	__P((void));
 | 
			
		||||
void	arm8_cache_flushID_E	__P((u_int));
 | 
			
		||||
void	arm8_cache_cleanID	__P((void));
 | 
			
		||||
void	arm8_cache_cleanID_E	__P((u_int));
 | 
			
		||||
void	arm8_cache_purgeID	__P((void));
 | 
			
		||||
void	arm8_cache_purgeID_E	__P((u_int entry));
 | 
			
		||||
 | 
			
		||||
void	arm8_cache_syncI	__P((void));
 | 
			
		||||
void	arm8_cache_cleanID_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm8_cache_cleanD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm8_cache_purgeID_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm8_cache_purgeD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm8_cache_syncI_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	arm8_context_switch	__P((void));
 | 
			
		||||
 | 
			
		||||
void	arm8_setup		__P((char *));
 | 
			
		||||
 | 
			
		||||
u_int	arm8_clock_config	__P((u_int, u_int));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_SA110
 | 
			
		||||
void	sa110_setup		__P((char *));
 | 
			
		||||
void	sa110_context_switch	__P((void));
 | 
			
		||||
#endif	/* CPU_SA110 */
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_SA1100) || defined(CPU_SA1110)
 | 
			
		||||
void	sa11x0_drain_readbuf	__P((void));
 | 
			
		||||
 | 
			
		||||
void	sa11x0_context_switch	__P((void));
 | 
			
		||||
void	sa11x0_cpu_sleep	__P((int));
 | 
			
		||||
 | 
			
		||||
void	sa11x0_setup		__P((char *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110)
 | 
			
		||||
void	sa1_setttb		__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	sa1_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	sa1_cache_flushID	__P((void));
 | 
			
		||||
void	sa1_cache_flushI	__P((void));
 | 
			
		||||
void	sa1_cache_flushD	__P((void));
 | 
			
		||||
void	sa1_cache_flushD_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	sa1_cache_cleanID	__P((void));
 | 
			
		||||
void	sa1_cache_cleanD	__P((void));
 | 
			
		||||
void	sa1_cache_cleanD_E	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	sa1_cache_purgeID	__P((void));
 | 
			
		||||
void	sa1_cache_purgeID_E	__P((u_int));
 | 
			
		||||
void	sa1_cache_purgeD	__P((void));
 | 
			
		||||
void	sa1_cache_purgeD_E	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	sa1_cache_syncI		__P((void));
 | 
			
		||||
void	sa1_cache_cleanID_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	sa1_cache_cleanD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	sa1_cache_purgeID_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	sa1_cache_purgeD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	sa1_cache_syncI_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM9
 | 
			
		||||
void	arm9_setttb		__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	arm9_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	arm9_icache_sync_all	__P((void));
 | 
			
		||||
void	arm9_icache_sync_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	arm9_dcache_wbinv_all	__P((void));
 | 
			
		||||
void	arm9_dcache_wbinv_range __P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm9_dcache_inv_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	arm9_dcache_wb_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	arm9_idcache_wbinv_all	__P((void));
 | 
			
		||||
void	arm9_idcache_wbinv_range __P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	arm9_context_switch	__P((void));
 | 
			
		||||
 | 
			
		||||
void	arm9_setup		__P((char *));
 | 
			
		||||
 | 
			
		||||
extern unsigned arm9_dcache_sets_max;
 | 
			
		||||
extern unsigned arm9_dcache_sets_inc;
 | 
			
		||||
extern unsigned arm9_dcache_index_max;
 | 
			
		||||
extern unsigned arm9_dcache_index_inc;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_ARM9E) || defined(CPU_ARM10)
 | 
			
		||||
void	arm10_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
void	arm10_tlb_flushI_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	arm10_context_switch	__P((void));
 | 
			
		||||
 | 
			
		||||
void	arm10_setup		__P((char *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef CPU_ARM11
 | 
			
		||||
void	arm11_setttb		__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	arm11_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
void	arm11_tlb_flushI_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	arm11_context_switch	__P((void));
 | 
			
		||||
 | 
			
		||||
void	arm11_setup		__P((char *string));
 | 
			
		||||
void	arm11_tlb_flushID	__P((void));
 | 
			
		||||
void	arm11_tlb_flushI	__P((void));
 | 
			
		||||
void	arm11_tlb_flushD	__P((void));
 | 
			
		||||
void	arm11_tlb_flushD_SE	__P((u_int va));
 | 
			
		||||
 | 
			
		||||
void	arm11_drain_writebuf	__P((void));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_ARM9E) || defined (CPU_ARM10)
 | 
			
		||||
void	armv5_ec_setttb			__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	armv5_ec_icache_sync_all	__P((void));
 | 
			
		||||
void	armv5_ec_icache_sync_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	armv5_ec_dcache_wbinv_all	__P((void));
 | 
			
		||||
void	armv5_ec_dcache_wbinv_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	armv5_ec_dcache_inv_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	armv5_ec_dcache_wb_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	armv5_ec_idcache_wbinv_all	__P((void));
 | 
			
		||||
void	armv5_ec_idcache_wbinv_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined (CPU_ARM10) || defined (CPU_ARM11)
 | 
			
		||||
void	armv5_setttb		__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	armv5_icache_sync_all	__P((void));
 | 
			
		||||
void	armv5_icache_sync_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	armv5_dcache_wbinv_all	__P((void));
 | 
			
		||||
void	armv5_dcache_wbinv_range __P((vaddr_t, vsize_t));
 | 
			
		||||
void	armv5_dcache_inv_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	armv5_dcache_wb_range	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	armv5_idcache_wbinv_all	__P((void));
 | 
			
		||||
void	armv5_idcache_wbinv_range __P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
extern unsigned armv5_dcache_sets_max;
 | 
			
		||||
extern unsigned armv5_dcache_sets_inc;
 | 
			
		||||
extern unsigned armv5_dcache_index_max;
 | 
			
		||||
extern unsigned armv5_dcache_index_inc;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_ARM9) || defined(CPU_ARM9E) || defined(CPU_ARM10) || \
 | 
			
		||||
    defined(CPU_SA110) || defined(CPU_SA1100) || defined(CPU_SA1110) || \
 | 
			
		||||
    defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \
 | 
			
		||||
    defined(__CPU_XSCALE_PXA2XX) || defined(CPU_XSCALE_IXP425)
 | 
			
		||||
 | 
			
		||||
void	armv4_tlb_flushID	__P((void));
 | 
			
		||||
void	armv4_tlb_flushI	__P((void));
 | 
			
		||||
void	armv4_tlb_flushD	__P((void));
 | 
			
		||||
void	armv4_tlb_flushD_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	armv4_drain_writebuf	__P((void));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_IXP12X0)
 | 
			
		||||
void	ixp12x0_drain_readbuf	__P((void));
 | 
			
		||||
void	ixp12x0_context_switch	__P((void));
 | 
			
		||||
void	ixp12x0_setup		__P((char *));
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \
 | 
			
		||||
    defined(__CPU_XSCALE_PXA2XX) || defined(CPU_XSCALE_IXP425)
 | 
			
		||||
void	xscale_cpwait		__P((void));
 | 
			
		||||
 | 
			
		||||
void	xscale_cpu_sleep	__P((int));
 | 
			
		||||
 | 
			
		||||
u_int	xscale_control		__P((u_int, u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_setttb		__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_tlb_flushID_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_cache_flushID	__P((void));
 | 
			
		||||
void	xscale_cache_flushI	__P((void));
 | 
			
		||||
void	xscale_cache_flushD	__P((void));
 | 
			
		||||
void	xscale_cache_flushD_SE	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_cache_cleanID	__P((void));
 | 
			
		||||
void	xscale_cache_cleanD	__P((void));
 | 
			
		||||
void	xscale_cache_cleanD_E	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_cache_clean_minidata __P((void));
 | 
			
		||||
 | 
			
		||||
void	xscale_cache_purgeID	__P((void));
 | 
			
		||||
void	xscale_cache_purgeID_E	__P((u_int));
 | 
			
		||||
void	xscale_cache_purgeD	__P((void));
 | 
			
		||||
void	xscale_cache_purgeD_E	__P((u_int));
 | 
			
		||||
 | 
			
		||||
void	xscale_cache_syncI	__P((void));
 | 
			
		||||
void	xscale_cache_cleanID_rng __P((vaddr_t, vsize_t));
 | 
			
		||||
void	xscale_cache_cleanD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	xscale_cache_purgeID_rng __P((vaddr_t, vsize_t));
 | 
			
		||||
void	xscale_cache_purgeD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	xscale_cache_syncI_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
void	xscale_cache_flushD_rng	__P((vaddr_t, vsize_t));
 | 
			
		||||
 | 
			
		||||
void	xscale_context_switch	__P((void));
 | 
			
		||||
 | 
			
		||||
void	xscale_setup		__P((char *));
 | 
			
		||||
#endif	/* CPU_XSCALE_80200 || CPU_XSCALE_80321 || __CPU_XSCALE_PXA2XX || CPU_XSCALE_IXP425 */
 | 
			
		||||
 | 
			
		||||
#define tlb_flush	cpu_tlb_flushID
 | 
			
		||||
#define setttb		cpu_setttb
 | 
			
		||||
#define drain_writebuf	cpu_drain_writebuf
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Macros for manipulating CPU interrupts
 | 
			
		||||
 */
 | 
			
		||||
#ifdef __PROG32
 | 
			
		||||
static __inline u_int32_t __set_cpsr_c(u_int bic, u_int eor) __attribute__((__unused__));
 | 
			
		||||
 | 
			
		||||
static __inline u_int32_t
 | 
			
		||||
__set_cpsr_c(u_int bic, u_int eor)
 | 
			
		||||
{
 | 
			
		||||
	u_int32_t	tmp, ret;
 | 
			
		||||
 | 
			
		||||
	__asm volatile(
 | 
			
		||||
		"mrs     %0, cpsr\n"	/* Get the CPSR */
 | 
			
		||||
		"bic	 %1, %0, %2\n"	/* Clear bits */
 | 
			
		||||
		"eor	 %1, %1, %3\n"	/* XOR bits */
 | 
			
		||||
		"msr     cpsr_c, %1\n"	/* Set the control field of CPSR */
 | 
			
		||||
	: "=&r" (ret), "=&r" (tmp)
 | 
			
		||||
	: "r" (bic), "r" (eor) : "memory");
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define disable_interrupts(mask)					\
 | 
			
		||||
	(__set_cpsr_c((mask) & (I32_bit | F32_bit), \
 | 
			
		||||
		      (mask) & (I32_bit | F32_bit)))
 | 
			
		||||
 | 
			
		||||
#define enable_interrupts(mask)						\
 | 
			
		||||
	(__set_cpsr_c((mask) & (I32_bit | F32_bit), 0))
 | 
			
		||||
 | 
			
		||||
#define restore_interrupts(old_cpsr)					\
 | 
			
		||||
	(__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit)))
 | 
			
		||||
#else /* ! __PROG32 */
 | 
			
		||||
#define	disable_interrupts(mask)					\
 | 
			
		||||
	(set_r15((mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE),		\
 | 
			
		||||
		 (mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE)))
 | 
			
		||||
 | 
			
		||||
#define	enable_interrupts(mask)						\
 | 
			
		||||
	(set_r15((mask) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE), 0))
 | 
			
		||||
 | 
			
		||||
#define	restore_interrupts(old_r15)					\
 | 
			
		||||
	(set_r15((R15_IRQ_DISABLE | R15_FIQ_DISABLE),			\
 | 
			
		||||
		 (old_r15) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE)))
 | 
			
		||||
#endif /* __PROG32 */
 | 
			
		||||
 | 
			
		||||
#ifdef __PROG32
 | 
			
		||||
/* Functions to manipulate the CPSR. */
 | 
			
		||||
u_int	SetCPSR(u_int, u_int);
 | 
			
		||||
u_int	GetCPSR(void);
 | 
			
		||||
#else
 | 
			
		||||
/* Functions to manipulate the processor control bits in r15. */
 | 
			
		||||
u_int	set_r15(u_int, u_int);
 | 
			
		||||
u_int	get_r15(void);
 | 
			
		||||
#endif /* __PROG32 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Functions to manipulate cpu r13
 | 
			
		||||
 * (in arm/arm32/setstack.S)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
void set_stackptr	__P((u_int, u_int));
 | 
			
		||||
u_int get_stackptr	__P((u_int));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Miscellany
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
int get_pc_str_offset	__P((void));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * CPU functions from locore.S
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
void cpu_reset		__P((void)) __attribute__((__noreturn__));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Cache info variables.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* PRIMARY CACHE VARIABLES */
 | 
			
		||||
extern int	arm_picache_size;
 | 
			
		||||
extern int	arm_picache_line_size;
 | 
			
		||||
extern int	arm_picache_ways;
 | 
			
		||||
 | 
			
		||||
extern int	arm_pdcache_size;	/* and unified */
 | 
			
		||||
extern int	arm_pdcache_line_size;
 | 
			
		||||
extern int	arm_pdcache_ways;
 | 
			
		||||
 | 
			
		||||
extern int	arm_pcache_type;
 | 
			
		||||
extern int	arm_pcache_unified;
 | 
			
		||||
 | 
			
		||||
extern int	arm_dcache_align;
 | 
			
		||||
extern int	arm_dcache_align_mask;
 | 
			
		||||
 | 
			
		||||
#endif	/* _KERNEL */
 | 
			
		||||
#endif	/* _ARM32_CPUFUNC_H_ */
 | 
			
		||||
 | 
			
		||||
/* End of cpufunc.h */
 | 
			
		||||
							
								
								
									
										31
									
								
								StdLib/Include/Arm/machine/float.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								StdLib/Include/Arm/machine/float.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
			
		||||
/*	$NetBSD: float.h,v 1.6 2005/12/11 12:16:47 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM_FLOAT_H_
 | 
			
		||||
#define _ARM_FLOAT_H_
 | 
			
		||||
 | 
			
		||||
#ifndef __VFP_FP__
 | 
			
		||||
#define LDBL_MANT_DIG	64
 | 
			
		||||
#define LDBL_EPSILON	1.0842021724855044340E-19L
 | 
			
		||||
#define LDBL_DIG	18
 | 
			
		||||
#define LDBL_MIN_EXP	(-16381)
 | 
			
		||||
#define LDBL_MIN	1.6810515715560467531E-4932L
 | 
			
		||||
#define LDBL_MIN_10_EXP	(-4931)
 | 
			
		||||
#define LDBL_MAX_EXP	16384
 | 
			
		||||
#define LDBL_MAX	1.1897314953572317650E+4932L
 | 
			
		||||
#define LDBL_MAX_10_EXP	4932
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <sys/float_ieee754.h>
 | 
			
		||||
 | 
			
		||||
#ifndef __VFP_FP__
 | 
			
		||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
 | 
			
		||||
    !defined(_XOPEN_SOURCE) || \
 | 
			
		||||
    ((__STDC_VERSION__ - 0) >= 199901L) || \
 | 
			
		||||
    ((_POSIX_C_SOURCE - 0) >= 200112L) || \
 | 
			
		||||
    ((_XOPEN_SOURCE  - 0) >= 600) || \
 | 
			
		||||
    defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
 | 
			
		||||
#define	DECIMAL_DIG	21
 | 
			
		||||
#endif /* !defined(_ANSI_SOURCE) && ... */
 | 
			
		||||
#endif /* !__VFP_FP__ */
 | 
			
		||||
 | 
			
		||||
#endif /* !_ARM_FLOAT_H_ */
 | 
			
		||||
							
								
								
									
										123
									
								
								StdLib/Include/Arm/machine/frame.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								StdLib/Include/Arm/machine/frame.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,123 @@
 | 
			
		||||
/*	$NetBSD: frame.h,v 1.8 2005/12/11 12:16:47 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1994-1997 Mark Brinicombe.
 | 
			
		||||
 * Copyright (c) 1994 Brini.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software written for Brini by Mark Brinicombe
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by Brini.
 | 
			
		||||
 * 4. The name of the company nor the name of the author may be used to
 | 
			
		||||
 *    endorse or promote products derived from this software without specific
 | 
			
		||||
 *    prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 | 
			
		||||
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
			
		||||
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 | 
			
		||||
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
 * arm/frame.h - Stack frames structures common to arm26 and arm32
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM_FRAME_H_
 | 
			
		||||
#define _ARM_FRAME_H_
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
#include <sys/signal.h>
 | 
			
		||||
#include <sys/sa.h>
 | 
			
		||||
#include <sys/ucontext.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Trap frame.  Pushed onto the kernel stack on a trap (synchronous exception).
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct trapframe {
 | 
			
		||||
	register_t tf_spsr; /* Zero on arm26 */
 | 
			
		||||
	register_t tf_r0;
 | 
			
		||||
	register_t tf_r1;
 | 
			
		||||
	register_t tf_r2;
 | 
			
		||||
	register_t tf_r3;
 | 
			
		||||
	register_t tf_r4;
 | 
			
		||||
	register_t tf_r5;
 | 
			
		||||
	register_t tf_r6;
 | 
			
		||||
	register_t tf_r7;
 | 
			
		||||
	register_t tf_r8;
 | 
			
		||||
	register_t tf_r9;
 | 
			
		||||
	register_t tf_r10;
 | 
			
		||||
	register_t tf_r11;
 | 
			
		||||
	register_t tf_r12;
 | 
			
		||||
	register_t tf_usr_sp;
 | 
			
		||||
	register_t tf_usr_lr;
 | 
			
		||||
	register_t tf_svc_sp; /* Not used on arm26 */
 | 
			
		||||
	register_t tf_svc_lr; /* Not used on arm26 */
 | 
			
		||||
	register_t tf_pc;
 | 
			
		||||
} trapframe_t;
 | 
			
		||||
 | 
			
		||||
/* Register numbers */
 | 
			
		||||
#define tf_r13 tf_usr_sp
 | 
			
		||||
#define tf_r14 tf_usr_lr
 | 
			
		||||
#define tf_r15 tf_pc
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Signal frame.  Pushed onto user stack before calling sigcode.
 | 
			
		||||
 */
 | 
			
		||||
#ifdef COMPAT_16
 | 
			
		||||
struct sigframe_sigcontext {
 | 
			
		||||
	struct	sigcontext sf_sc;
 | 
			
		||||
};
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* the pointers are use in the trampoline code to locate the ucontext */
 | 
			
		||||
struct sigframe_siginfo {
 | 
			
		||||
	siginfo_t	sf_si;		/* actual saved siginfo */
 | 
			
		||||
	ucontext_t	sf_uc;		/* actual saved ucontext */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Scheduler activations upcall frame.  Pushed onto user stack before
 | 
			
		||||
 * calling an SA upcall.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct saframe {
 | 
			
		||||
#if 0 /* in registers on entry to upcall */
 | 
			
		||||
	int		sa_type;
 | 
			
		||||
	struct sa_t **	sa_sas;
 | 
			
		||||
	int		sa_events;
 | 
			
		||||
	int		sa_interrupted;
 | 
			
		||||
#endif
 | 
			
		||||
	void *		sa_arg;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
void sendsig_sigcontext(const ksiginfo_t *, const sigset_t *);
 | 
			
		||||
void *getframe(struct lwp *, int, int *);
 | 
			
		||||
__END_DECLS
 | 
			
		||||
#define process_frame(l) ((l)->l_addr->u_pcb.pcb_tf)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _LOCORE */
 | 
			
		||||
 | 
			
		||||
#endif /* _ARM_FRAME_H_ */
 | 
			
		||||
  
 | 
			
		||||
/* End of frame.h */
 | 
			
		||||
							
								
								
									
										13
									
								
								StdLib/Include/Arm/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								StdLib/Include/Arm/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
/*	$NetBSD: ieee.h,v 1.9 2005/12/11 12:16:47 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <sys/ieee754.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
 | 
			
		||||
 * high fraction; if the bit is set, it is a `quiet NaN'.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
#define	SNG_QUIETNAN	(1 << 22)
 | 
			
		||||
#define	DBL_QUIETNAN	(1 << 19)
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										89
									
								
								StdLib/Include/Arm/machine/lock.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								StdLib/Include/Arm/machine/lock.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,89 @@
 | 
			
		||||
/*	$NetBSD: lock.h,v 1.7 2005/12/28 19:09:29 perry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Jason R. Thorpe.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by the NetBSD
 | 
			
		||||
 *	Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine-dependent spin lock operations.
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE: The SWP insn used here is available only on ARM architecture
 | 
			
		||||
 * version 3 and later (as well as 2a).  What we are going to do is
 | 
			
		||||
 * expect that the kernel will trap and emulate the insn.  That will
 | 
			
		||||
 * be slow, but give us the atomicity that we need.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM_LOCK_H_
 | 
			
		||||
#define	_ARM_LOCK_H_
 | 
			
		||||
 | 
			
		||||
static __inline int
 | 
			
		||||
__swp(int __val, volatile int *__ptr)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	__asm volatile("swp %0, %1, [%2]"
 | 
			
		||||
	    : "=r" (__val) : "r" (__val), "r" (__ptr) : "memory");
 | 
			
		||||
	return __val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void __attribute__((__unused__))
 | 
			
		||||
__cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	*alp = __SIMPLELOCK_UNLOCKED;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void __attribute__((__unused__))
 | 
			
		||||
__cpu_simple_lock(__cpu_simple_lock_t *alp)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	while (__swp(__SIMPLELOCK_LOCKED, alp) != __SIMPLELOCK_UNLOCKED)
 | 
			
		||||
		continue;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline int __attribute__((__unused__))
 | 
			
		||||
__cpu_simple_lock_try(__cpu_simple_lock_t *alp)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	return (__swp(__SIMPLELOCK_LOCKED, alp) == __SIMPLELOCK_UNLOCKED);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void __attribute__((__unused__))
 | 
			
		||||
__cpu_simple_unlock(__cpu_simple_lock_t *alp)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	*alp = __SIMPLELOCK_UNLOCKED;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* _ARM_LOCK_H_ */
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Arm/machine/math.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Arm/machine/math.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: math.h,v 1.2 2002/02/19 13:08:14 simonb Exp $	*/
 | 
			
		||||
 | 
			
		||||
#define	__HAVE_NANF
 | 
			
		||||
							
								
								
									
										114
									
								
								StdLib/Include/Arm/machine/mcontext.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								StdLib/Include/Arm/machine/mcontext.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,114 @@
 | 
			
		||||
/*	$NetBSD: mcontext.h,v 1.5 2005/12/11 12:16:47 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein and by Jason R. Thorpe of Wasabi Systems, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ARM_MCONTEXT_H_
 | 
			
		||||
#define _ARM_MCONTEXT_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * General register state
 | 
			
		||||
 */
 | 
			
		||||
#define _NGREG		17
 | 
			
		||||
typedef unsigned int	__greg_t;
 | 
			
		||||
typedef __greg_t	__gregset_t[_NGREG];
 | 
			
		||||
 | 
			
		||||
#define _REG_R0		0
 | 
			
		||||
#define _REG_R1		1
 | 
			
		||||
#define _REG_R2		2
 | 
			
		||||
#define _REG_R3		3
 | 
			
		||||
#define _REG_R4		4
 | 
			
		||||
#define _REG_R5		5
 | 
			
		||||
#define _REG_R6		6
 | 
			
		||||
#define _REG_R7		7
 | 
			
		||||
#define _REG_R8		8
 | 
			
		||||
#define _REG_R9		9
 | 
			
		||||
#define _REG_R10	10
 | 
			
		||||
#define _REG_R11	11
 | 
			
		||||
#define _REG_R12	12
 | 
			
		||||
#define _REG_R13	13
 | 
			
		||||
#define _REG_R14	14
 | 
			
		||||
#define _REG_R15	15
 | 
			
		||||
#define _REG_CPSR	16
 | 
			
		||||
/* Convenience synonyms */
 | 
			
		||||
#define _REG_FP		_REG_R11
 | 
			
		||||
#define _REG_SP		_REG_R13
 | 
			
		||||
#define _REG_LR		_REG_R14
 | 
			
		||||
#define _REG_PC		_REG_R15
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Floating point register state
 | 
			
		||||
 */
 | 
			
		||||
/* Note: the storage layout of this structure must be identical to ARMFPE! */
 | 
			
		||||
typedef struct {
 | 
			
		||||
	unsigned int	__fp_fpsr;
 | 
			
		||||
	struct {
 | 
			
		||||
		unsigned int	__fp_exponent;
 | 
			
		||||
		unsigned int	__fp_mantissa_hi;
 | 
			
		||||
		unsigned int	__fp_mantissa_lo;
 | 
			
		||||
	}		__fp_fr[8];
 | 
			
		||||
} __fpregset_t;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
	unsigned int	__vfp_fpscr;
 | 
			
		||||
	unsigned int	__vfp_fstmx[33];
 | 
			
		||||
	unsigned int	__vfp_fpsid;
 | 
			
		||||
} __vfpregset_t;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
	__gregset_t	__gregs;
 | 
			
		||||
	union {
 | 
			
		||||
		__fpregset_t __fpregs;
 | 
			
		||||
		__vfpregset_t __vfpregs;
 | 
			
		||||
	} __fpu;
 | 
			
		||||
} mcontext_t;
 | 
			
		||||
 | 
			
		||||
/* Machine-dependent uc_flags */
 | 
			
		||||
#define	_UC_ARM_VFP	0x00010000	/* FPU field is VFP */
 | 
			
		||||
 | 
			
		||||
/* used by signal delivery to indicate status of signal stack */
 | 
			
		||||
#define _UC_SETSTACK	0x00020000
 | 
			
		||||
#define _UC_CLRSTACK	0x00040000
 | 
			
		||||
 | 
			
		||||
#define _UC_MACHINE_PAD	3		/* Padding appended to ucontext_t */
 | 
			
		||||
 | 
			
		||||
#define _UC_MACHINE_SP(uc)	((uc)->uc_mcontext.__gregs[_REG_SP])
 | 
			
		||||
#define _UC_MACHINE_PC(uc)	((uc)->uc_mcontext.__gregs[_REG_PC])
 | 
			
		||||
#define _UC_MACHINE_INTRV(uc)	((uc)->uc_mcontext.__gregs[_REG_R0])
 | 
			
		||||
 | 
			
		||||
#define	_UC_MACHINE_SET_PC(uc, pc)	_UC_MACHINE_PC(uc) = (pc)
 | 
			
		||||
 | 
			
		||||
#endif	/* !_ARM_MCONTEXT_H_ */
 | 
			
		||||
							
								
								
									
										55
									
								
								StdLib/Include/Arm/machine/proc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								StdLib/Include/Arm/machine/proc.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,55 @@
 | 
			
		||||
/*	$NetBSD: proc.h,v 1.6 2003/03/05 11:28:14 agc Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1994 Mark Brinicombe.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by the RiscBSD team.
 | 
			
		||||
 * 4. The name "RiscBSD" nor the name of the author may be used to
 | 
			
		||||
 *    endorse or promote products derived from this software without specific
 | 
			
		||||
 *    prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 | 
			
		||||
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 | 
			
		||||
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
			
		||||
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 | 
			
		||||
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_ARM32_PROC_H_
 | 
			
		||||
#define	_ARM32_PROC_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine-dependent part of the proc structure for arm.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct trapframe;
 | 
			
		||||
struct lwp;
 | 
			
		||||
 | 
			
		||||
struct mdlwp {
 | 
			
		||||
	int	md_dummy;		/* must have at least one member */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mdproc {
 | 
			
		||||
	void	(*md_syscall)(struct trapframe *, struct lwp *, u_int32_t);
 | 
			
		||||
	int	pmc_enabled;		/* bitfield of enabled counters */
 | 
			
		||||
	void	*pmc_state;		/* port-specific pmc state */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif /* _ARM32_PROC_H_ */
 | 
			
		||||
							
								
								
									
										22
									
								
								StdLib/Include/Arm/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								StdLib/Include/Arm/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
/**
 | 
			
		||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials are licensed and made available under
 | 
			
		||||
the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
The full text of the license may be found at
 | 
			
		||||
http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHINE_SIGNAL_H
 | 
			
		||||
#define _MACHINE_SIGNAL_H
 | 
			
		||||
#include  <sys/common.h>
 | 
			
		||||
 | 
			
		||||
/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of
 | 
			
		||||
    an object that can be accessed as an atomic entity, even in the presence
 | 
			
		||||
    of asynchronous interrupts.
 | 
			
		||||
**/
 | 
			
		||||
typedef INTN sig_atomic_t;
 | 
			
		||||
 | 
			
		||||
#endif    /* _MACHINE_SIGNAL_H */
 | 
			
		||||
							
								
								
									
										18
									
								
								StdLib/Include/Ia32/machine/_math.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								StdLib/Include/Ia32/machine/_math.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials are licensed and made available under
 | 
			
		||||
the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
The full text of the license may be found at
 | 
			
		||||
http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHINE_MATH_H
 | 
			
		||||
#define _MACHINE_MATH_H
 | 
			
		||||
 | 
			
		||||
//#define __HUGE_VAL  ???????????.?????????????
 | 
			
		||||
 | 
			
		||||
#endif    /* _MACHINE_MATH_H */
 | 
			
		||||
							
								
								
									
										94
									
								
								StdLib/Include/Ia32/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										94
									
								
								StdLib/Include/Ia32/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,94 @@
 | 
			
		||||
/*	$NetBSD: ansi.h,v 1.19 2006/10/04 13:52:00 tnozaki Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)ansi.h	8.2 (Berkeley) 1/4/94
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_ANSI_H_
 | 
			
		||||
#define	_ANSI_H_
 | 
			
		||||
 | 
			
		||||
#include  <sys/EfiCdefs.h>
 | 
			
		||||
 | 
			
		||||
#include <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types which are fundamental to the implementation and may appear in
 | 
			
		||||
 * more than one standard header are defined here.  Standard headers
 | 
			
		||||
 * then use:
 | 
			
		||||
 *	#ifdef	_BSD_SIZE_T_
 | 
			
		||||
 *	typedef	_BSD_SIZE_T_ size_t;
 | 
			
		||||
 *	#undef	_BSD_SIZE_T_
 | 
			
		||||
 *	#endif
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_CLOCK_T_     _EFI_CLOCK_T      /* clock() */
 | 
			
		||||
#define _BSD_PTRDIFF_T_   _EFI_PTRDIFF_T_   /* ptr1 - ptr2 */
 | 
			
		||||
#define _BSD_SIZE_T_      _EFI_SIZE_T_      /* sizeof() */
 | 
			
		||||
#define _BSD_SSIZE_T_     INTN              /* byte count or error */
 | 
			
		||||
#define _BSD_TIME_T_      _EFI_TIME_T       /* time() */
 | 
			
		||||
#define _BSD_VA_LIST_     VA_LIST
 | 
			
		||||
#define _BSD_CLOCKID_T_   INT64             /* clockid_t */
 | 
			
		||||
#define _BSD_TIMER_T_     INT64             /* timer_t */
 | 
			
		||||
#define _BSD_SUSECONDS_T_ INT64             /* suseconds_t */
 | 
			
		||||
#define _BSD_USECONDS_T_  UINT64            /* useconds_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
 | 
			
		||||
 * be instantiated outside of lib/libc/locale.  use wchar_t.
 | 
			
		||||
 *
 | 
			
		||||
 * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
 | 
			
		||||
 * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
 | 
			
		||||
 * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
 | 
			
		||||
 * it looks like 10646 will be a 31 bit standard.  This means that if your
 | 
			
		||||
 * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
 | 
			
		||||
 * chosen over a long is that the is*() and to*() routines take ints (says
 | 
			
		||||
 * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you
 | 
			
		||||
 * lose a bit of ANSI conformance, but your programs will still work.
 | 
			
		||||
 *    
 | 
			
		||||
 * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
 | 
			
		||||
 * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
 | 
			
		||||
 * defined for ctype.h.
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_WCHAR_T_     _EFI_WCHAR_T    /* wchar_t */
 | 
			
		||||
#define _BSD_WINT_T_      _EFI_WINT_T     /* wint_t */
 | 
			
		||||
#define _BSD_RUNE_T_      _EFI_WCHAR_T    /* rune_t */
 | 
			
		||||
#define _BSD_WCTRANS_T_		void *		/* wctrans_t */
 | 
			
		||||
#define _BSD_WCTYPE_T_    unsigned int    /* wctype_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * mbstate_t is an opaque object to keep conversion state, during multibyte
 | 
			
		||||
 * stream conversions.  The content must not be referenced by user programs.
 | 
			
		||||
 */
 | 
			
		||||
typedef union {
 | 
			
		||||
	__int64_t __mbstateL;	/* for alignment */
 | 
			
		||||
	char __mbstate8[128];
 | 
			
		||||
} __mbstate_t;
 | 
			
		||||
#define	_BSD_MBSTATE_T_		__mbstate_t	/* mbstate_t */
 | 
			
		||||
 | 
			
		||||
#endif	/* _ANSI_H_ */
 | 
			
		||||
							
								
								
									
										208
									
								
								StdLib/Include/Ia32/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										208
									
								
								StdLib/Include/Ia32/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,208 @@
 | 
			
		||||
/*	$NetBSD: asm.h,v 1.30 2006/01/20 22:02:40 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)asm.h	5.5 (Berkeley) 5/7/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _I386_ASM_H_
 | 
			
		||||
#define _I386_ASM_H_
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL_OPT
 | 
			
		||||
#include "opt_multiprocessor.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef PIC
 | 
			
		||||
#define PIC_PROLOGUE	\
 | 
			
		||||
	pushl	%ebx;	\
 | 
			
		||||
	call	1f;	\
 | 
			
		||||
1:			\
 | 
			
		||||
	popl	%ebx;	\
 | 
			
		||||
	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
 | 
			
		||||
#define PIC_EPILOGUE	\
 | 
			
		||||
	popl	%ebx
 | 
			
		||||
#define PIC_PLT(x)	x@PLT
 | 
			
		||||
#define PIC_GOT(x)	x@GOT(%ebx)
 | 
			
		||||
#define PIC_GOTOFF(x)	x@GOTOFF(%ebx)
 | 
			
		||||
#else
 | 
			
		||||
#define PIC_PROLOGUE
 | 
			
		||||
#define PIC_EPILOGUE
 | 
			
		||||
#define PIC_PLT(x)	x
 | 
			
		||||
#define PIC_GOT(x)	x
 | 
			
		||||
#define PIC_GOTOFF(x)	x
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
# define _C_LABEL(x)	x
 | 
			
		||||
#else
 | 
			
		||||
# ifdef __STDC__
 | 
			
		||||
#  define _C_LABEL(x)	_ ## x
 | 
			
		||||
# else
 | 
			
		||||
#  define _C_LABEL(x)	_/**/x
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
#define	_ASM_LABEL(x)	x
 | 
			
		||||
 | 
			
		||||
#define CVAROFF(x, y)		_C_LABEL(x) + y
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
# define __CONCAT(x,y)	x ## y
 | 
			
		||||
# define __STRING(x)	#x
 | 
			
		||||
#else
 | 
			
		||||
# define __CONCAT(x,y)	x/**/y
 | 
			
		||||
# define __STRING(x)	"x"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* let kernels and others override entrypoint alignment */
 | 
			
		||||
#if !defined(_ALIGN_TEXT) && !defined(_KERNEL)
 | 
			
		||||
# ifdef __ELF__
 | 
			
		||||
#  define _ALIGN_TEXT .align 4
 | 
			
		||||
# else
 | 
			
		||||
#  define _ALIGN_TEXT .align 2
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define _ENTRY(x) \
 | 
			
		||||
	.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
#if defined(MULTIPROCESSOR)
 | 
			
		||||
#define CPUVAR(off) %fs:__CONCAT(CPU_INFO_,off)
 | 
			
		||||
#else
 | 
			
		||||
#define CPUVAR(off) _C_LABEL(cpu_info_primary)+__CONCAT(CPU_INFO_,off)
 | 
			
		||||
#endif /* MULTIPROCESSOR */
 | 
			
		||||
 | 
			
		||||
/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
 | 
			
		||||
#else 
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
 | 
			
		||||
#endif /* __STDC__ */ 
 | 
			
		||||
#else 
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl _X ## name; .type _X ## name,@function; _X ## name: 
 | 
			
		||||
#else
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl _X/**/name; .type _X/**/name,@function; _X/**/name:
 | 
			
		||||
#endif /* __STDC__ */
 | 
			
		||||
#endif /* __ELF__ */
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define ALIGN_DATA	.align	4
 | 
			
		||||
#define ALIGN_TEXT	.align	4,0x90  /* 4-byte boundaries, NOP-filled */
 | 
			
		||||
#define SUPERALIGN_TEXT	.align	16,0x90 /* 16-byte boundaries better for 486 */
 | 
			
		||||
#else
 | 
			
		||||
#define ALIGN_DATA	.align	2
 | 
			
		||||
#define ALIGN_TEXT	.align	2,0x90  /* 4-byte boundaries, NOP-filled */
 | 
			
		||||
#define SUPERALIGN_TEXT	.align	4,0x90  /* 16-byte boundaries better for 486 */
 | 
			
		||||
#endif /* __ELF__ */
 | 
			
		||||
 | 
			
		||||
#define _ALIGN_TEXT ALIGN_TEXT
 | 
			
		||||
 | 
			
		||||
#ifdef GPROF
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define	MCOUNT_ASM	call	_C_LABEL(__mcount)
 | 
			
		||||
#else /* __ELF__ */
 | 
			
		||||
#define	MCOUNT_ASM	call	_C_LABEL(mcount)
 | 
			
		||||
#endif /* __ELF__ */
 | 
			
		||||
#else /* GPROF */
 | 
			
		||||
#define	MCOUNT_ASM	/* nothing */
 | 
			
		||||
#endif /* GPROF */
 | 
			
		||||
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef GPROF
 | 
			
		||||
# ifdef __ELF__
 | 
			
		||||
#  define _PROF_PROLOGUE	\
 | 
			
		||||
	pushl %ebp; movl %esp,%ebp; call PIC_PLT(__mcount); popl %ebp
 | 
			
		||||
# else 
 | 
			
		||||
#  define _PROF_PROLOGUE	\
 | 
			
		||||
	pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
# define _PROF_PROLOGUE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
#define	NENTRY(y)	_ENTRY(_C_LABEL(y))
 | 
			
		||||
#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
 | 
			
		||||
#define	ASMSTR		.asciz
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define RCSID(x)	.section ".ident"; .asciz x
 | 
			
		||||
#else
 | 
			
		||||
#define RCSID(x)	.text; .asciz x
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef NO_KERNEL_RCSIDS
 | 
			
		||||
#define	__KERNEL_RCSID(_n, _s)	/* nothing */
 | 
			
		||||
#else
 | 
			
		||||
#define	__KERNEL_RCSID(_n, _s)	RCSID(_s)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __ELF__
 | 
			
		||||
#define	WEAK_ALIAS(alias,sym)						\
 | 
			
		||||
	.weak alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
#endif
 | 
			
		||||
/*
 | 
			
		||||
 * STRONG_ALIAS: create a strong alias.
 | 
			
		||||
 */
 | 
			
		||||
#define STRONG_ALIAS(alias,sym)						\
 | 
			
		||||
	.globl alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg ## ,30,0,0,0 ;					\
 | 
			
		||||
	.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
 | 
			
		||||
#elif defined(__ELF__)
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg,30,0,0,0 ;						\
 | 
			
		||||
	.stabs __STRING(sym),1,0,0,0
 | 
			
		||||
#else
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg,30,0,0,0 ;						\
 | 
			
		||||
	.stabs __STRING(_/**/sym),1,0,0,0
 | 
			
		||||
#endif /* __STDC__ */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* !_I386_ASM_H_ */
 | 
			
		||||
							
								
								
									
										13
									
								
								StdLib/Include/Ia32/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								StdLib/Include/Ia32/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
/*      $NetBSD: bswap.h,v 1.3 2006/01/31 07:49:18 dsl Exp $      */
 | 
			
		||||
 | 
			
		||||
/* Written by Manuel Bouyer. Public domain */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_BSWAP_H_
 | 
			
		||||
#define	_MACHINE_BSWAP_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/byte_swap.h>
 | 
			
		||||
 | 
			
		||||
#define __BSWAP_RENAME
 | 
			
		||||
#include <sys/bswap.h>
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_BSWAP_H_ */
 | 
			
		||||
							
								
								
									
										79
									
								
								StdLib/Include/Ia32/machine/byte_swap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										79
									
								
								StdLib/Include/Ia32/machine/byte_swap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,79 @@
 | 
			
		||||
/*	$NetBSD: byte_swap.h,v 1.10 2006/01/30 22:46:36 dsl Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Charles M. Hannum.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _I386_BYTE_SWAP_H_
 | 
			
		||||
#define	_I386_BYTE_SWAP_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_KERNEL_OPT)
 | 
			
		||||
#include "opt_cputype.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef  __GNUC__
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define	__BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
 | 
			
		||||
static __inline uint32_t __byte_swap_u32_variable(uint32_t);
 | 
			
		||||
static __inline uint32_t
 | 
			
		||||
__byte_swap_u32_variable(uint32_t x)
 | 
			
		||||
{
 | 
			
		||||
	__asm volatile (
 | 
			
		||||
#if defined(_KERNEL) && !defined(_LKM) && !defined(I386_CPU)
 | 
			
		||||
	    "bswap %1"
 | 
			
		||||
#else
 | 
			
		||||
	    "rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1"
 | 
			
		||||
#endif
 | 
			
		||||
	    : "=r" (x) : "0" (x));
 | 
			
		||||
	return (x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define	__BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
 | 
			
		||||
static __inline uint16_t __byte_swap_u16_variable(uint16_t);
 | 
			
		||||
static __inline uint16_t
 | 
			
		||||
__byte_swap_u16_variable(uint16_t x)
 | 
			
		||||
{
 | 
			
		||||
	__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x)); 
 | 
			
		||||
	return (x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_I386_BYTE_SWAP_H_ */
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian.h,v 1.29 2000/03/17 00:09:20 mycroft Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <sys/endian.h>
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian_machdep.h,v 1.3 2006/01/30 21:52:38 dsl Exp $	*/
 | 
			
		||||
 | 
			
		||||
#define _BYTE_ORDER _LITTLE_ENDIAN
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/float.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/float.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*  $NetBSD: float.h,v 1.12 2003/02/26 21:29:00 fvdl Exp $  */
 | 
			
		||||
 | 
			
		||||
#include <x86/float.h>
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: ieee.h,v 1.2 2003/02/26 21:29:01 fvdl Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <x86/ieee.h>
 | 
			
		||||
							
								
								
									
										63
									
								
								StdLib/Include/Ia32/machine/int_const.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								StdLib/Include/Ia32/machine/int_const.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,63 @@
 | 
			
		||||
/*	$NetBSD: int_const.h,v 1.1 2001/04/14 22:38:38 kleink Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _I386_INT_CONST_H_
 | 
			
		||||
#define _I386_INT_CONST_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.4 Macros for integer constants
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.4.1 Macros for minimum-width integer constants */
 | 
			
		||||
 | 
			
		||||
#define	INT8_C(c)	c
 | 
			
		||||
#define	INT16_C(c)	c
 | 
			
		||||
#define	INT32_C(c)	c
 | 
			
		||||
#define	INT64_C(c)	c ## LL
 | 
			
		||||
 | 
			
		||||
#define	UINT8_C(c)	c ## U
 | 
			
		||||
#define	UINT16_C(c)	c ## U
 | 
			
		||||
#define	UINT32_C(c)	c ## U
 | 
			
		||||
#define	UINT64_C(c)	c ## ULL
 | 
			
		||||
 | 
			
		||||
/* 7.18.4.2 Macros for greatest-width integer constants */
 | 
			
		||||
 | 
			
		||||
#define	INTMAX_C(c)	c ## LL
 | 
			
		||||
#define	UINTMAX_C(c)	c ## ULL
 | 
			
		||||
 | 
			
		||||
#endif /* !_I386_INT_CONST_H_ */
 | 
			
		||||
							
								
								
									
										141
									
								
								StdLib/Include/Ia32/machine/int_limits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										141
									
								
								StdLib/Include/Ia32/machine/int_limits.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,141 @@
 | 
			
		||||
/** @file
 | 
			
		||||
  7.18.2 Limits of specified-width integer types.
 | 
			
		||||
 | 
			
		||||
  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
  This program and the accompanying materials are licensed and made available under
 | 
			
		||||
  the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
  The full text of the license may be found at
 | 
			
		||||
  http://opensource.org/licenses/bsd-license.
 | 
			
		||||
 | 
			
		||||
  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
  NetBSD: int_limits.h,v 1.5 2004/05/22 14:16:59 kleink Exp
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _I386_INT_LIMITS_H_
 | 
			
		||||
#define _I386_INT_LIMITS_H_
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.1 Limits of exact-width integer types */
 | 
			
		||||
 | 
			
		||||
/* minimum values of exact-width signed integer types */
 | 
			
		||||
#define INT8_MIN  ((-0x7f)-1)     /* int8_t   */
 | 
			
		||||
#define INT16_MIN ((-0x7fff)-1)     /* int16_t    */
 | 
			
		||||
#define INT32_MIN ((-0x7fffffff)-1)     /* int32_t    */
 | 
			
		||||
#define INT64_MIN ((-0x7fffffffffffffffLL)-1) /* int64_t    */
 | 
			
		||||
 | 
			
		||||
/* maximum values of exact-width signed integer types */
 | 
			
		||||
#define INT8_MAX  0x7f        /* int8_t   */
 | 
			
		||||
#define INT16_MAX 0x7fff        /* int16_t    */
 | 
			
		||||
#define INT32_MAX 0x7fffffff      /* int32_t    */
 | 
			
		||||
#define INT64_MAX 0x7fffffffffffffffLL    /* int64_t    */
 | 
			
		||||
 | 
			
		||||
/* maximum values of exact-width unsigned integer types */
 | 
			
		||||
#define UINT8_MAX 0xffU       /* uint8_t    */
 | 
			
		||||
#define UINT16_MAX  0xffffU       /* uint16_t   */
 | 
			
		||||
#define UINT32_MAX  0xffffffffU     /* uint32_t   */
 | 
			
		||||
#define UINT64_MAX  0xffffffffffffffffULL   /* uint64_t   */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.2 Limits of minimum-width integer types */
 | 
			
		||||
 | 
			
		||||
/* minimum values of minimum-width signed integer types */
 | 
			
		||||
#define INT_LEAST8_MIN  ((-0x7f)-1)     /* int_least8_t   */
 | 
			
		||||
#define INT_LEAST16_MIN ((-0x7fff)-1)     /* int_least16_t  */
 | 
			
		||||
#define INT_LEAST32_MIN ((-0x7fffffff)-1)     /* int_least32_t  */
 | 
			
		||||
#define INT_LEAST64_MIN ((-0x7fffffffffffffffLL)-1) /* int_least64_t  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of minimum-width signed integer types */
 | 
			
		||||
#define INT_LEAST8_MAX  0x7f        /* int_least8_t   */
 | 
			
		||||
#define INT_LEAST16_MAX 0x7fff        /* int_least16_t  */
 | 
			
		||||
#define INT_LEAST32_MAX 0x7fffffff      /* int_least32_t  */
 | 
			
		||||
#define INT_LEAST64_MAX 0x7fffffffffffffffLL    /* int_least64_t  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of minimum-width unsigned integer types */
 | 
			
		||||
#define UINT_LEAST8_MAX  0xffU        /* uint_least8_t  */
 | 
			
		||||
#define UINT_LEAST16_MAX 0xffffU      /* uint_least16_t */
 | 
			
		||||
#define UINT_LEAST32_MAX 0xffffffffU      /* uint_least32_t */
 | 
			
		||||
#define UINT_LEAST64_MAX 0xffffffffffffffffULL    /* uint_least64_t */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.3 Limits of fastest minimum-width integer types */
 | 
			
		||||
 | 
			
		||||
/* minimum values of fastest minimum-width signed integer types */
 | 
			
		||||
#define INT_FAST8_MIN ((-0x7f)-1)     /* int_fast8_t    */
 | 
			
		||||
#define INT_FAST16_MIN  ((-0x7fffffff)-1)     /* int_fast16_t   */
 | 
			
		||||
#define INT_FAST32_MIN  ((-0x7fffffff)-1)     /* int_fast32_t   */
 | 
			
		||||
#define INT_FAST64_MIN  ((-0x7fffffffffffffffLL-1) /* int_fast64_t   */
 | 
			
		||||
 | 
			
		||||
/* maximum values of fastest minimum-width signed integer types */
 | 
			
		||||
#define INT_FAST8_MAX 0x7f        /* int_fast8_t    */
 | 
			
		||||
#define INT_FAST16_MAX  0x7fffffff      /* int_fast16_t   */
 | 
			
		||||
#define INT_FAST32_MAX  0x7fffffff      /* int_fast32_t   */
 | 
			
		||||
#define INT_FAST64_MAX  0x7fffffffffffffffLL    /* int_fast64_t   */
 | 
			
		||||
 | 
			
		||||
/* maximum values of fastest minimum-width unsigned integer types */
 | 
			
		||||
#define UINT_FAST8_MAX  0xffU       /* uint_fast8_t   */
 | 
			
		||||
#define UINT_FAST16_MAX 0xffffffffU     /* uint_fast16_t  */
 | 
			
		||||
#define UINT_FAST32_MAX 0xffffffffU     /* uint_fast32_t  */
 | 
			
		||||
#define UINT_FAST64_MAX 0xffffffffffffffffULL   /* uint_fast64_t  */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.4 Limits of integer types capable of holding object pointers */
 | 
			
		||||
 | 
			
		||||
#define INTPTR_MIN  ((-0x7fffffff)-1)     /* intptr_t   */
 | 
			
		||||
#define INTPTR_MAX  0x7fffffff      /* intptr_t   */
 | 
			
		||||
#define UINTPTR_MAX 0xffffffffU     /* uintptr_t    */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.5 Limits of greatest-width integer types */
 | 
			
		||||
 | 
			
		||||
#define INTMAX_MIN  ((-0x7fffffffffffffffLL)-1) /* intmax_t   */
 | 
			
		||||
#define INTMAX_MAX     0x7fffffffffffffffLL    /* intmax_t   */
 | 
			
		||||
#define UINTMAX_MAX    0xffffffffffffffffULL   /* uintmax_t    */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.3 Limits of other integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* limits of ptrdiff_t */
 | 
			
		||||
#define PTRDIFF_MIN ((-0x7fffffff)-1)     /* ptrdiff_t    */
 | 
			
		||||
#define PTRDIFF_MAX 0x7fffffff      /* ptrdiff_t    */
 | 
			
		||||
 | 
			
		||||
/* limits of sig_atomic_t */
 | 
			
		||||
#define SIG_ATOMIC_MIN  ((-0x7fffffff)-1)     /* sig_atomic_t   */
 | 
			
		||||
#define SIG_ATOMIC_MAX  0x7fffffff      /* sig_atomic_t   */
 | 
			
		||||
 | 
			
		||||
/* limit of size_t */
 | 
			
		||||
#define SIZE_MAX  0xffffffffU     /* size_t   */
 | 
			
		||||
#define SIZE_T_MAX  SIZE_MAX
 | 
			
		||||
 | 
			
		||||
#endif /* !_I386_INT_LIMITS_H_ */
 | 
			
		||||
							
								
								
									
										82
									
								
								StdLib/Include/Ia32/machine/int_mwgwtypes.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								StdLib/Include/Ia32/machine/int_mwgwtypes.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    Minimum and Greatest Width Integer types.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials are licensed and made available under
 | 
			
		||||
    the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
    The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
    Portions Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
 | 
			
		||||
    This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
    by Klaus Klein.
 | 
			
		||||
 | 
			
		||||
    Redistribution and use in source and binary forms, with or without
 | 
			
		||||
    modification, are permitted provided that the following conditions
 | 
			
		||||
    are met:
 | 
			
		||||
      1.  Redistributions of source code must retain the above copyright
 | 
			
		||||
          notice, this list of conditions and the following disclaimer.
 | 
			
		||||
      2.  Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
          notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
          documentation and/or other materials provided with the distribution.
 | 
			
		||||
      3.  All advertising materials mentioning features or use of this software
 | 
			
		||||
          must display the following acknowledgement:
 | 
			
		||||
            This product includes software developed by the NetBSD
 | 
			
		||||
            Foundation, Inc. and its contributors.
 | 
			
		||||
      4.  Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
          contributors may be used to endorse or promote products derived
 | 
			
		||||
          from this software without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
    THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
    POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
    NetBSD: int_mwgwtypes.h,v 1.5 2005/12/24 20:06:47 perry Exp
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _AMD64_INT_MWGWTYPES_H_
 | 
			
		||||
#define _AMD64_INT_MWGWTYPES_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.1 Integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.2 Minimum-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef CHAR8     int_least8_t;
 | 
			
		||||
typedef UINT8     uint_least8_t;
 | 
			
		||||
typedef INT16     int_least16_t;
 | 
			
		||||
typedef UINT16    uint_least16_t;
 | 
			
		||||
typedef INT32     int_least32_t;
 | 
			
		||||
typedef UINT32    uint_least32_t;
 | 
			
		||||
typedef INT64     int_least64_t;
 | 
			
		||||
typedef UINT64    uint_least64_t;
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.3 Fastest minimum-width integer types */
 | 
			
		||||
typedef INT32     int_fast8_t;
 | 
			
		||||
typedef UINT32    uint_fast8_t;
 | 
			
		||||
typedef INT32     int_fast16_t;
 | 
			
		||||
typedef UINT32    uint_fast16_t;
 | 
			
		||||
typedef INT32     int_fast32_t;
 | 
			
		||||
typedef UINT32    uint_fast32_t;
 | 
			
		||||
typedef INT64     int_fast64_t;
 | 
			
		||||
typedef UINT64    uint_fast64_t;
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.5 Greatest-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef INT64     intmax_t;
 | 
			
		||||
typedef UINT64    uintmax_t;
 | 
			
		||||
 | 
			
		||||
#endif /* !_AMD64_INT_MWGWTYPES_H_ */
 | 
			
		||||
							
								
								
									
										61
									
								
								StdLib/Include/Ia32/machine/int_types.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								StdLib/Include/Ia32/machine/int_types.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
/*  $NetBSD: int_types.h,v 1.10 2005/12/24 20:07:10 perry Exp $ */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *  from: @(#)types.h 7.5 (Berkeley) 3/9/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _I386_INT_TYPES_H_
 | 
			
		||||
#define _I386_INT_TYPES_H_
 | 
			
		||||
 | 
			
		||||
#include  <sys/EfiCdefs.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.1 Integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.1 Exact-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef INT8    __int8_t;
 | 
			
		||||
typedef UINT8   __uint8_t;
 | 
			
		||||
typedef INT16   __int16_t;
 | 
			
		||||
typedef UINT16  __uint16_t;
 | 
			
		||||
typedef INT32   __int32_t;
 | 
			
		||||
typedef UINT32  __uint32_t;
 | 
			
		||||
typedef INT64   __int64_t;
 | 
			
		||||
typedef UINT64  __uint64_t;
 | 
			
		||||
 | 
			
		||||
#define __BIT_TYPES_DEFINED__
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.4 Integer types capable of holding object pointers */
 | 
			
		||||
 | 
			
		||||
typedef INTN    __intptr_t;
 | 
			
		||||
typedef UINTN   __uintptr_t;
 | 
			
		||||
 | 
			
		||||
#endif  /* !_I386_INT_TYPES_H_ */
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/limits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/limits.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
#include  <x86/limits.h>
 | 
			
		||||
 | 
			
		||||
#define __POINTER_BIT   32
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ia32/machine/math.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ia32/machine/math.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: math.h,v 1.3 2005/12/11 12:16:25 christos Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <x86/math.h>
 | 
			
		||||
							
								
								
									
										174
									
								
								StdLib/Include/Ia32/machine/param.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								StdLib/Include/Ia32/machine/param.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,174 @@
 | 
			
		||||
/*	$NetBSD: param.h,v 1.61 2006/08/28 13:43:35 yamt Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)param.h	5.8 (Berkeley) 6/28/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _I386_PARAM_H_
 | 
			
		||||
#define _I386_PARAM_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine dependent constants for Intel 386.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
#ifdef _LOCORE
 | 
			
		||||
#include <machine/psl.h>
 | 
			
		||||
#else
 | 
			
		||||
#include <machine/cpu.h>
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	_MACHINE	i386
 | 
			
		||||
#define	MACHINE		"i386"
 | 
			
		||||
#define	_MACHINE_ARCH	i386
 | 
			
		||||
#define	MACHINE_ARCH	"i386"
 | 
			
		||||
#define	MID_MACHINE	MID_I386
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Round p (pointer or byte index) up to a correctly-aligned value
 | 
			
		||||
 * for all data types (int, long, ...).   The result is u_int and
 | 
			
		||||
 * must be cast to any desired pointer type.
 | 
			
		||||
 *
 | 
			
		||||
 * ALIGNED_POINTER is a boolean macro that checks whether an address
 | 
			
		||||
 * is valid to fetch data elements of type t from on this architecture.
 | 
			
		||||
 * This does not reflect the optimal alignment, just the possibility
 | 
			
		||||
 * (within reasonable limits). 
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
#define ALIGNBYTES		(sizeof(int) - 1)
 | 
			
		||||
#define ALIGN(p)		(((u_int)(u_long)(p) + ALIGNBYTES) &~ \
 | 
			
		||||
    ALIGNBYTES)
 | 
			
		||||
#define ALIGNED_POINTER(p,t)	1
 | 
			
		||||
 | 
			
		||||
#define	PGSHIFT		12		/* LOG2(NBPG) */
 | 
			
		||||
#define	NBPG		(1 << PGSHIFT)	/* bytes/page */
 | 
			
		||||
#define	PGOFSET		(NBPG-1)	/* byte offset into page */
 | 
			
		||||
#define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
 | 
			
		||||
 | 
			
		||||
#if defined(_KERNEL_OPT)
 | 
			
		||||
#include "opt_kernbase.h"
 | 
			
		||||
#endif /* defined(_KERNEL_OPT) */
 | 
			
		||||
 | 
			
		||||
#ifdef KERNBASE_LOCORE
 | 
			
		||||
#error "You should only re-define KERNBASE"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef	KERNBASE
 | 
			
		||||
#define	KERNBASE	0xc0000000UL	/* start of kernel virtual space */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	KERNTEXTOFF	(KERNBASE + 0x100000) /* start of kernel text */
 | 
			
		||||
#define	BTOPKERNBASE	(KERNBASE >> PGSHIFT)
 | 
			
		||||
 | 
			
		||||
#define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
 | 
			
		||||
#define	DEV_BSIZE	(1 << DEV_BSHIFT)
 | 
			
		||||
#define	BLKDEV_IOSIZE	2048
 | 
			
		||||
#ifndef	MAXPHYS
 | 
			
		||||
#define	MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	SSIZE		1		/* initial stack size/NBPG */
 | 
			
		||||
#define	SINCR		1		/* increment of stack/NBPG */
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL_OPT
 | 
			
		||||
#include "opt_noredzone.h"
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef UPAGES
 | 
			
		||||
#ifdef NOREDZONE
 | 
			
		||||
#define	UPAGES		2		/* pages of u-area */
 | 
			
		||||
#else
 | 
			
		||||
#define UPAGES		3
 | 
			
		||||
#endif /*NOREDZONE */
 | 
			
		||||
#endif /* !defined(UPAGES) */
 | 
			
		||||
#define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
 | 
			
		||||
 | 
			
		||||
#ifndef MSGBUFSIZE
 | 
			
		||||
#define MSGBUFSIZE	4*NBPG		/* default message buffer size */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Constants related to network buffer management.
 | 
			
		||||
 * MCLBYTES must be no larger than NBPG (the software page size), and,
 | 
			
		||||
 * on machines that exchange pages of input or output buffers with mbuf
 | 
			
		||||
 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
 | 
			
		||||
 * of the hardware page size.
 | 
			
		||||
 */
 | 
			
		||||
#define	MSIZE		256		/* size of an mbuf */
 | 
			
		||||
 | 
			
		||||
#ifndef MCLSHIFT
 | 
			
		||||
#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
 | 
			
		||||
					/* 2K cluster can hold Ether frame */
 | 
			
		||||
#endif	/* MCLSHIFT */
 | 
			
		||||
 | 
			
		||||
#define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
 | 
			
		||||
 | 
			
		||||
#ifndef NMBCLUSTERS
 | 
			
		||||
#if defined(_KERNEL_OPT)
 | 
			
		||||
#include "opt_gateway.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GATEWAY
 | 
			
		||||
#define	NMBCLUSTERS	2048		/* map size, max cluster allocation */
 | 
			
		||||
#else
 | 
			
		||||
#define	NMBCLUSTERS	1024		/* map size, max cluster allocation */
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NFS_RSIZE
 | 
			
		||||
#define NFS_RSIZE	32768
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NFS_WSIZE
 | 
			
		||||
#define NFS_WSIZE	32768
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
 | 
			
		||||
 * logical pages.
 | 
			
		||||
 */
 | 
			
		||||
#define	NKMEMPAGES_MIN_DEFAULT	((8 * 1024 * 1024) >> PAGE_SHIFT)
 | 
			
		||||
#define	NKMEMPAGES_MAX_DEFAULT	((128 * 1024 * 1024) >> PAGE_SHIFT)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Mach derived conversion macros
 | 
			
		||||
 */
 | 
			
		||||
#define	x86_round_pdr(x)	((((unsigned)(x)) + PDOFSET) & ~PDOFSET)
 | 
			
		||||
#define	x86_trunc_pdr(x)	((unsigned)(x) & ~PDOFSET)
 | 
			
		||||
#define	x86_btod(x)		((unsigned)(x) >> PDSHIFT)
 | 
			
		||||
#define	x86_dtob(x)		((unsigned)(x) << PDSHIFT)
 | 
			
		||||
#define	x86_round_page(x)	((((unsigned)(x)) + PGOFSET) & ~PGOFSET)
 | 
			
		||||
#define	x86_trunc_page(x)	((unsigned)(x) & ~PGOFSET)
 | 
			
		||||
#define	x86_btop(x)		((unsigned)(x) >> PGSHIFT)
 | 
			
		||||
#define	x86_ptob(x)		((unsigned)(x) << PGSHIFT)
 | 
			
		||||
 | 
			
		||||
#endif /* _I386_PARAM_H_ */
 | 
			
		||||
							
								
								
									
										22
									
								
								StdLib/Include/Ia32/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								StdLib/Include/Ia32/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
/**
 | 
			
		||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials are licensed and made available under
 | 
			
		||||
the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
The full text of the license may be found at
 | 
			
		||||
http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHINE_SIGNAL_H
 | 
			
		||||
#define _MACHINE_SIGNAL_H
 | 
			
		||||
#include  <sys/EfiCdefs.h>
 | 
			
		||||
 | 
			
		||||
/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of
 | 
			
		||||
    an object that can be accessed as an atomic entity, even in the presence
 | 
			
		||||
    of asynchronous interrupts.
 | 
			
		||||
**/
 | 
			
		||||
typedef INTN sig_atomic_t;
 | 
			
		||||
 | 
			
		||||
#endif    /* _MACHINE_SIGNAL_H */
 | 
			
		||||
							
								
								
									
										81
									
								
								StdLib/Include/Ia32/machine/types.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										81
									
								
								StdLib/Include/Ia32/machine/types.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,81 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    Machine dependent type definitions.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials are licensed and made available
 | 
			
		||||
    under the terms and conditions of the BSD License that accompanies this
 | 
			
		||||
    distribution.  The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
 | 
			
		||||
    Redistribution and use in source and binary forms, with or without
 | 
			
		||||
    modification, are permitted provided that the following conditions
 | 
			
		||||
    are met:
 | 
			
		||||
    1. Redistributions of source code must retain the above copyright
 | 
			
		||||
       notice, this list of conditions and the following disclaimer.
 | 
			
		||||
    2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
       notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
       documentation and/or other materials provided with the distribution.
 | 
			
		||||
    3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
       may be used to endorse or promote products derived from this software
 | 
			
		||||
       without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
    SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
    types.h 7.5 (Berkeley) 3/9/91
 | 
			
		||||
    NetBSD: types.h,v 1.49 2006/09/03 13:51:23 bjh21 Exp
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHTYPES_H_
 | 
			
		||||
#define _MACHTYPES_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/EfiCdefs.h>
 | 
			
		||||
#include <sys/featuretest.h>
 | 
			
		||||
#include <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/* Handle the long and unsigned long data types which EFI doesn't directly support. */
 | 
			
		||||
//typedef INTN              LONGN;
 | 
			
		||||
//typedef UINTN             ULONGN;
 | 
			
		||||
 | 
			
		||||
typedef PHYSICAL_ADDRESS  paddr_t;
 | 
			
		||||
typedef UINT64            psize_t;
 | 
			
		||||
typedef PHYSICAL_ADDRESS  vaddr_t;
 | 
			
		||||
typedef UINT64            vsize_t;
 | 
			
		||||
 | 
			
		||||
typedef INT32   pmc_evid_t;
 | 
			
		||||
typedef UINT64  pmc_ctr_t;
 | 
			
		||||
typedef INT32   register_t;
 | 
			
		||||
 | 
			
		||||
typedef volatile INT32    __cpu_simple_lock_t;
 | 
			
		||||
 | 
			
		||||
#define __SIMPLELOCK_LOCKED   1
 | 
			
		||||
#define __SIMPLELOCK_UNLOCKED 0
 | 
			
		||||
 | 
			
		||||
/* The x86 does not have strict alignment requirements. */
 | 
			
		||||
#define __NO_STRICT_ALIGNMENT
 | 
			
		||||
 | 
			
		||||
#define __HAVE_DEVICE_REGISTER
 | 
			
		||||
#define __HAVE_CPU_COUNTER
 | 
			
		||||
#define __HAVE_SYSCALL_INTERN
 | 
			
		||||
#define __HAVE_MINIMAL_EMUL
 | 
			
		||||
#define __HAVE_OLD_DISKLABEL
 | 
			
		||||
#define __HAVE_GENERIC_SOFT_INTERRUPTS
 | 
			
		||||
#define __HAVE_CPU_MAXPROC
 | 
			
		||||
#define __HAVE_TIMECOUNTER
 | 
			
		||||
#define __HAVE_GENERIC_TODR
 | 
			
		||||
 | 
			
		||||
#endif  /* _MACHTYPES_H_ */
 | 
			
		||||
							
								
								
									
										277
									
								
								StdLib/Include/Ipf/machine/_regset.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										277
									
								
								StdLib/Include/Ipf/machine/_regset.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,277 @@
 | 
			
		||||
/*	$NetBSD: _regset.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2002, 2003 Marcel Moolenaar
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_REGSET_H_
 | 
			
		||||
#define	_MACHINE_REGSET_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Create register sets, based on the runtime specification. This allows
 | 
			
		||||
 * us to better reuse code and to copy sets around more efficiently.
 | 
			
		||||
 * Contexts are defined in terms of these sets. These include trapframe,
 | 
			
		||||
 * sigframe, pcb, mcontext, reg and fpreg. Other candidates are unwind
 | 
			
		||||
 * and coredump related contexts.
 | 
			
		||||
 *
 | 
			
		||||
 * Notes:
 | 
			
		||||
 * o  Constant registers (r0, f0 and f1) are not accounted for,
 | 
			
		||||
 * o  The stacked registers (r32-r127) are not accounted for,
 | 
			
		||||
 * o  Predicates are not split across sets.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* A single FP register. */
 | 
			
		||||
union _ia64_fpreg {
 | 
			
		||||
	unsigned char	fpr_bits[16];
 | 
			
		||||
	long double	fpr_flt;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Special registers.
 | 
			
		||||
 */
 | 
			
		||||
struct _special {
 | 
			
		||||
	unsigned long		sp;
 | 
			
		||||
	unsigned long		unat;		/* NaT before spilling */
 | 
			
		||||
	unsigned long		rp;
 | 
			
		||||
	unsigned long		pr;
 | 
			
		||||
	unsigned long		pfs;
 | 
			
		||||
	unsigned long		bspstore;
 | 
			
		||||
	unsigned long		rnat;
 | 
			
		||||
	unsigned long		__spare;
 | 
			
		||||
	/* Userland context and syscalls */
 | 
			
		||||
	unsigned long		tp;
 | 
			
		||||
	unsigned long		rsc;
 | 
			
		||||
	unsigned long		fpsr;
 | 
			
		||||
	unsigned long		psr;
 | 
			
		||||
	/* ASYNC: Interrupt specific */
 | 
			
		||||
	unsigned long		gp;
 | 
			
		||||
	unsigned long		ndirty;
 | 
			
		||||
	unsigned long		cfm;
 | 
			
		||||
	unsigned long		iip;
 | 
			
		||||
	unsigned long		ifa;
 | 
			
		||||
	unsigned long		isr;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _high_fp {
 | 
			
		||||
	union _ia64_fpreg	fr32;
 | 
			
		||||
	union _ia64_fpreg	fr33;
 | 
			
		||||
	union _ia64_fpreg	fr34;
 | 
			
		||||
	union _ia64_fpreg	fr35;
 | 
			
		||||
	union _ia64_fpreg	fr36;
 | 
			
		||||
	union _ia64_fpreg	fr37;
 | 
			
		||||
	union _ia64_fpreg	fr38;
 | 
			
		||||
	union _ia64_fpreg	fr39;
 | 
			
		||||
	union _ia64_fpreg	fr40;
 | 
			
		||||
	union _ia64_fpreg	fr41;
 | 
			
		||||
	union _ia64_fpreg	fr42;
 | 
			
		||||
	union _ia64_fpreg	fr43;
 | 
			
		||||
	union _ia64_fpreg	fr44;
 | 
			
		||||
	union _ia64_fpreg	fr45;
 | 
			
		||||
	union _ia64_fpreg	fr46;
 | 
			
		||||
	union _ia64_fpreg	fr47;
 | 
			
		||||
	union _ia64_fpreg	fr48;
 | 
			
		||||
	union _ia64_fpreg	fr49;
 | 
			
		||||
	union _ia64_fpreg	fr50;
 | 
			
		||||
	union _ia64_fpreg	fr51;
 | 
			
		||||
	union _ia64_fpreg	fr52;
 | 
			
		||||
	union _ia64_fpreg	fr53;
 | 
			
		||||
	union _ia64_fpreg	fr54;
 | 
			
		||||
	union _ia64_fpreg	fr55;
 | 
			
		||||
	union _ia64_fpreg	fr56;
 | 
			
		||||
	union _ia64_fpreg	fr57;
 | 
			
		||||
	union _ia64_fpreg	fr58;
 | 
			
		||||
	union _ia64_fpreg	fr59;
 | 
			
		||||
	union _ia64_fpreg	fr60;
 | 
			
		||||
	union _ia64_fpreg	fr61;
 | 
			
		||||
	union _ia64_fpreg	fr62;
 | 
			
		||||
	union _ia64_fpreg	fr63;
 | 
			
		||||
	union _ia64_fpreg	fr64;
 | 
			
		||||
	union _ia64_fpreg	fr65;
 | 
			
		||||
	union _ia64_fpreg	fr66;
 | 
			
		||||
	union _ia64_fpreg	fr67;
 | 
			
		||||
	union _ia64_fpreg	fr68;
 | 
			
		||||
	union _ia64_fpreg	fr69;
 | 
			
		||||
	union _ia64_fpreg	fr70;
 | 
			
		||||
	union _ia64_fpreg	fr71;
 | 
			
		||||
	union _ia64_fpreg	fr72;
 | 
			
		||||
	union _ia64_fpreg	fr73;
 | 
			
		||||
	union _ia64_fpreg	fr74;
 | 
			
		||||
	union _ia64_fpreg	fr75;
 | 
			
		||||
	union _ia64_fpreg	fr76;
 | 
			
		||||
	union _ia64_fpreg	fr77;
 | 
			
		||||
	union _ia64_fpreg	fr78;
 | 
			
		||||
	union _ia64_fpreg	fr79;
 | 
			
		||||
	union _ia64_fpreg	fr80;
 | 
			
		||||
	union _ia64_fpreg	fr81;
 | 
			
		||||
	union _ia64_fpreg	fr82;
 | 
			
		||||
	union _ia64_fpreg	fr83;
 | 
			
		||||
	union _ia64_fpreg	fr84;
 | 
			
		||||
	union _ia64_fpreg	fr85;
 | 
			
		||||
	union _ia64_fpreg	fr86;
 | 
			
		||||
	union _ia64_fpreg	fr87;
 | 
			
		||||
	union _ia64_fpreg	fr88;
 | 
			
		||||
	union _ia64_fpreg	fr89;
 | 
			
		||||
	union _ia64_fpreg	fr90;
 | 
			
		||||
	union _ia64_fpreg	fr91;
 | 
			
		||||
	union _ia64_fpreg	fr92;
 | 
			
		||||
	union _ia64_fpreg	fr93;
 | 
			
		||||
	union _ia64_fpreg	fr94;
 | 
			
		||||
	union _ia64_fpreg	fr95;
 | 
			
		||||
	union _ia64_fpreg	fr96;
 | 
			
		||||
	union _ia64_fpreg	fr97;
 | 
			
		||||
	union _ia64_fpreg	fr98;
 | 
			
		||||
	union _ia64_fpreg	fr99;
 | 
			
		||||
	union _ia64_fpreg	fr100;
 | 
			
		||||
	union _ia64_fpreg	fr101;
 | 
			
		||||
	union _ia64_fpreg	fr102;
 | 
			
		||||
	union _ia64_fpreg	fr103;
 | 
			
		||||
	union _ia64_fpreg	fr104;
 | 
			
		||||
	union _ia64_fpreg	fr105;
 | 
			
		||||
	union _ia64_fpreg	fr106;
 | 
			
		||||
	union _ia64_fpreg	fr107;
 | 
			
		||||
	union _ia64_fpreg	fr108;
 | 
			
		||||
	union _ia64_fpreg	fr109;
 | 
			
		||||
	union _ia64_fpreg	fr110;
 | 
			
		||||
	union _ia64_fpreg	fr111;
 | 
			
		||||
	union _ia64_fpreg	fr112;
 | 
			
		||||
	union _ia64_fpreg	fr113;
 | 
			
		||||
	union _ia64_fpreg	fr114;
 | 
			
		||||
	union _ia64_fpreg	fr115;
 | 
			
		||||
	union _ia64_fpreg	fr116;
 | 
			
		||||
	union _ia64_fpreg	fr117;
 | 
			
		||||
	union _ia64_fpreg	fr118;
 | 
			
		||||
	union _ia64_fpreg	fr119;
 | 
			
		||||
	union _ia64_fpreg	fr120;
 | 
			
		||||
	union _ia64_fpreg	fr121;
 | 
			
		||||
	union _ia64_fpreg	fr122;
 | 
			
		||||
	union _ia64_fpreg	fr123;
 | 
			
		||||
	union _ia64_fpreg	fr124;
 | 
			
		||||
	union _ia64_fpreg	fr125;
 | 
			
		||||
	union _ia64_fpreg	fr126;
 | 
			
		||||
	union _ia64_fpreg	fr127;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Preserved registers.
 | 
			
		||||
 */
 | 
			
		||||
struct _callee_saved {
 | 
			
		||||
	unsigned long		unat;		/* NaT after spilling. */
 | 
			
		||||
	unsigned long		gr4;
 | 
			
		||||
	unsigned long		gr5;
 | 
			
		||||
	unsigned long		gr6;
 | 
			
		||||
	unsigned long		gr7;
 | 
			
		||||
	unsigned long		br1;
 | 
			
		||||
	unsigned long		br2;
 | 
			
		||||
	unsigned long		br3;
 | 
			
		||||
	unsigned long		br4;
 | 
			
		||||
	unsigned long		br5;
 | 
			
		||||
	unsigned long		lc;
 | 
			
		||||
	unsigned long		__spare;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _callee_saved_fp {
 | 
			
		||||
	union _ia64_fpreg	fr2;
 | 
			
		||||
	union _ia64_fpreg	fr3;
 | 
			
		||||
	union _ia64_fpreg	fr4;
 | 
			
		||||
	union _ia64_fpreg	fr5;
 | 
			
		||||
	union _ia64_fpreg	fr16;
 | 
			
		||||
	union _ia64_fpreg	fr17;
 | 
			
		||||
	union _ia64_fpreg	fr18;
 | 
			
		||||
	union _ia64_fpreg	fr19;
 | 
			
		||||
	union _ia64_fpreg	fr20;
 | 
			
		||||
	union _ia64_fpreg	fr21;
 | 
			
		||||
	union _ia64_fpreg	fr22;
 | 
			
		||||
	union _ia64_fpreg	fr23;
 | 
			
		||||
	union _ia64_fpreg	fr24;
 | 
			
		||||
	union _ia64_fpreg	fr25;
 | 
			
		||||
	union _ia64_fpreg	fr26;
 | 
			
		||||
	union _ia64_fpreg	fr27;
 | 
			
		||||
	union _ia64_fpreg	fr28;
 | 
			
		||||
	union _ia64_fpreg	fr29;
 | 
			
		||||
	union _ia64_fpreg	fr30;
 | 
			
		||||
	union _ia64_fpreg	fr31;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Scratch registers.
 | 
			
		||||
 */
 | 
			
		||||
struct _caller_saved {
 | 
			
		||||
	unsigned long		unat;		/* NaT after spilling. */
 | 
			
		||||
	unsigned long		gr2;
 | 
			
		||||
	unsigned long		gr3;
 | 
			
		||||
	unsigned long		gr8;
 | 
			
		||||
	unsigned long		gr9;
 | 
			
		||||
	unsigned long		gr10;
 | 
			
		||||
	unsigned long		gr11;
 | 
			
		||||
	unsigned long		gr14;
 | 
			
		||||
	unsigned long		gr15;
 | 
			
		||||
	unsigned long		gr16;
 | 
			
		||||
	unsigned long		gr17;
 | 
			
		||||
	unsigned long		gr18;
 | 
			
		||||
	unsigned long		gr19;
 | 
			
		||||
	unsigned long		gr20;
 | 
			
		||||
	unsigned long		gr21;
 | 
			
		||||
	unsigned long		gr22;
 | 
			
		||||
	unsigned long		gr23;
 | 
			
		||||
	unsigned long		gr24;
 | 
			
		||||
	unsigned long		gr25;
 | 
			
		||||
	unsigned long		gr26;
 | 
			
		||||
	unsigned long		gr27;
 | 
			
		||||
	unsigned long		gr28;
 | 
			
		||||
	unsigned long		gr29;
 | 
			
		||||
	unsigned long		gr30;
 | 
			
		||||
	unsigned long		gr31;
 | 
			
		||||
	unsigned long		br6;
 | 
			
		||||
	unsigned long		br7;
 | 
			
		||||
	unsigned long		ccv;
 | 
			
		||||
	unsigned long		csd;
 | 
			
		||||
	unsigned long		ssd;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct _caller_saved_fp {
 | 
			
		||||
	union _ia64_fpreg	fr6;
 | 
			
		||||
	union _ia64_fpreg	fr7;
 | 
			
		||||
	union _ia64_fpreg	fr8;
 | 
			
		||||
	union _ia64_fpreg	fr9;
 | 
			
		||||
	union _ia64_fpreg	fr10;
 | 
			
		||||
	union _ia64_fpreg	fr11;
 | 
			
		||||
	union _ia64_fpreg	fr12;
 | 
			
		||||
	union _ia64_fpreg	fr13;
 | 
			
		||||
	union _ia64_fpreg	fr14;
 | 
			
		||||
	union _ia64_fpreg	fr15;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
void	restore_callee_saved(const struct _callee_saved *);
 | 
			
		||||
void	restore_callee_saved_fp(const struct _callee_saved_fp *);
 | 
			
		||||
void	restore_high_fp(const struct _high_fp *);
 | 
			
		||||
void	save_callee_saved(struct _callee_saved *);
 | 
			
		||||
void	save_callee_saved_fp(struct _callee_saved_fp *);
 | 
			
		||||
void	save_high_fp(struct _high_fp *);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif	/* _MACHINE_REGSET_H_ */
 | 
			
		||||
							
								
								
									
										107
									
								
								StdLib/Include/Ipf/machine/acpi_func.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								StdLib/Include/Ipf/machine/acpi_func.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,107 @@
 | 
			
		||||
/*	$NetBSD: acpi_func.h,v 1.2 2006/05/14 21:55:38 elad Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2002 Mitsuru IWASAKI
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/acpica_machdep.h,v 1.4 2004/10/11 05:39:15 njl Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/******************************************************************************
 | 
			
		||||
 *
 | 
			
		||||
 * Name: acpica_machdep.h - arch-specific defines, etc.
 | 
			
		||||
 *       $Revision: 1.2 $
 | 
			
		||||
 *
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_ACPI_FUNC_H_
 | 
			
		||||
#define _IA64_ACPI_FUNC_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/cpufunc.h>
 | 
			
		||||
#include <machine/atomic.h>
 | 
			
		||||
 | 
			
		||||
/* Asm macros */
 | 
			
		||||
 | 
			
		||||
#define ACPI_ASM_MACROS
 | 
			
		||||
#define BREAKPOINT3
 | 
			
		||||
#define ACPI_DISABLE_IRQS() disable_intr()
 | 
			
		||||
#define ACPI_ENABLE_IRQS()  enable_intr()
 | 
			
		||||
 | 
			
		||||
#define ACPI_FLUSH_CPU_CACHE()	/* XXX ia64_fc()? */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Section 5.2.9.1:  global lock acquire/release functions */
 | 
			
		||||
extern int	acpi_acquire_global_lock(uint32_t *lock);
 | 
			
		||||
extern int	acpi_release_global_lock(uint32_t *lock);
 | 
			
		||||
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
 | 
			
		||||
		((Acq) = acpi_acquire_global_lock(GLptr))
 | 
			
		||||
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
 | 
			
		||||
		((Acq) = acpi_release_global_lock(GLptr))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Section 5.2.9.1:  global lock acquire/release functions */
 | 
			
		||||
#define GL_ACQUIRED	(-1)
 | 
			
		||||
#define GL_BUSY		0
 | 
			
		||||
#define GL_BIT_PENDING	0x1
 | 
			
		||||
#define GL_BIT_OWNED	0x2
 | 
			
		||||
#define GL_BIT_MASK	(GL_BIT_PENDING | GL_BIT_OWNED)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Acquire the global lock.  If busy, set the pending bit.  The caller
 | 
			
		||||
 * will wait for notification from the BIOS that the lock is available
 | 
			
		||||
 * and then attempt to acquire it again.
 | 
			
		||||
 */
 | 
			
		||||
int
 | 
			
		||||
acpi_acquire_global_lock(uint32_t *lock)
 | 
			
		||||
{
 | 
			
		||||
	uint32_t new, old;
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		old = *lock;
 | 
			
		||||
		new = ((old & ~GL_BIT_MASK) | GL_BIT_OWNED) |
 | 
			
		||||
			((old >> 1) & GL_BIT_PENDING);
 | 
			
		||||
	} while (atomic_cmpset_acq_int(lock, old, new) == 0);
 | 
			
		||||
 | 
			
		||||
	return ((new < GL_BIT_MASK) ? GL_ACQUIRED : GL_BUSY);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Release the global lock, returning whether there is a waiter pending.
 | 
			
		||||
 * If the BIOS set the pending bit, OSPM must notify the BIOS when it
 | 
			
		||||
 * releases the lock.
 | 
			
		||||
 */
 | 
			
		||||
int
 | 
			
		||||
acpi_release_global_lock(uint32_t *lock)
 | 
			
		||||
{
 | 
			
		||||
	uint32_t new, old;
 | 
			
		||||
 | 
			
		||||
	do {
 | 
			
		||||
		old = *lock;
 | 
			
		||||
		new = old & ~GL_BIT_MASK;
 | 
			
		||||
	} while (atomic_cmpset_rel_int(lock, old, new) == 0);
 | 
			
		||||
 | 
			
		||||
	return (old & GL_BIT_PENDING);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* _IA64_ACPI_FUNC_H_ */
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ipf/machine/acpi_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ipf/machine/acpi_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: acpi_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								StdLib/Include/Ipf/machine/acpica_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								StdLib/Include/Ipf/machine/acpica_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
/*	$NetBSD: acpica_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
							
								
								
									
										95
									
								
								StdLib/Include/Ipf/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								StdLib/Include/Ipf/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,95 @@
 | 
			
		||||
/*  $NetBSD: ansi.h,v 1.3 2006/10/04 13:52:00 tnozaki Exp $ */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990, 1993
 | 
			
		||||
 *  The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *  @(#)ansi.h  8.2 (Berkeley) 1/4/94
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ANSI_H_
 | 
			
		||||
#define _ANSI_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/EfiCdefs.h>
 | 
			
		||||
#include <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types which are fundamental to the implementation and may appear in
 | 
			
		||||
 * more than one standard header are defined here.  Standard headers
 | 
			
		||||
 * then use:
 | 
			
		||||
 *      #ifdef  _SIZE_T_
 | 
			
		||||
 *      typedef _SIZE_T_ size_t;
 | 
			
		||||
 *      #undef  _SIZE_T_
 | 
			
		||||
 *      #endif
 | 
			
		||||
 *
 | 
			
		||||
 * Thanks, ANSI!
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_CLOCK_T_     _EFI_CLOCK_T      /* clock() */
 | 
			
		||||
#define _BSD_PTRDIFF_T_   _EFI_PTRDIFF_T_   /* ptr1 - ptr2 */
 | 
			
		||||
#define _BSD_SIZE_T_      _EFI_SIZE_T_      /* sizeof() */
 | 
			
		||||
#define _BSD_SSIZE_T_     INTN              /* byte count or error */
 | 
			
		||||
#define _BSD_TIME_T_      _EFI_TIME_T       /* time() */
 | 
			
		||||
 | 
			
		||||
#define _BSD_VA_LIST_     VA_LIST
 | 
			
		||||
#define _BSD_CLOCKID_T_   INT64             /* clockid_t */
 | 
			
		||||
#define _BSD_TIMER_T_     INT64             /* timer_t */
 | 
			
		||||
#define _BSD_SUSECONDS_T_ INT64             /* suseconds_t */
 | 
			
		||||
#define _BSD_USECONDS_T_  UINT64            /* useconds_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
 | 
			
		||||
 * be instantiated outside of lib/libc/locale.  use wchar_t.
 | 
			
		||||
 *
 | 
			
		||||
 * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
 | 
			
		||||
 * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
 | 
			
		||||
 * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
 | 
			
		||||
 * it looks like 10646 will be a 31 bit standard.  This means that if your
 | 
			
		||||
 * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
 | 
			
		||||
 * chosen over a long is that the is*() and to*() routines take ints (says
 | 
			
		||||
 * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you
 | 
			
		||||
 * lose a bit of ANSI conformance, but your programs will still work.
 | 
			
		||||
 *
 | 
			
		||||
 * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
 | 
			
		||||
 * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
 | 
			
		||||
 * defined for ctype.h.
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_WCHAR_T_     _EFI_WCHAR_T    /* wchar_t */
 | 
			
		||||
#define _BSD_WINT_T_      _EFI_WINT_T     /* wint_t */
 | 
			
		||||
#define _BSD_RUNE_T_      _EFI_WCHAR_T    /* rune_t */
 | 
			
		||||
#define _BSD_WCTRANS_T_   void *          /* wctrans_t */
 | 
			
		||||
#define _BSD_WCTYPE_T_    unsigned int    /* wctype_t */
 | 
			
		||||
/*
 | 
			
		||||
 * mbstate_t is an opaque object to keep conversion state, during multibyte
 | 
			
		||||
 * stream conversions.  The content must not be referenced by user programs.
 | 
			
		||||
 */
 | 
			
		||||
typedef union {
 | 
			
		||||
  __int64_t __mbstateL; /* for alignment */
 | 
			
		||||
  char __mbstate8[128];
 | 
			
		||||
} __mbstate_t;
 | 
			
		||||
#define _BSD_MBSTATE_T_   __mbstate_t /* mbstate_t */
 | 
			
		||||
 | 
			
		||||
#endif  /* _ANSI_H_ */
 | 
			
		||||
							
								
								
									
										36
									
								
								StdLib/Include/Ipf/machine/aout_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								StdLib/Include/Ipf/machine/aout_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,36 @@
 | 
			
		||||
/*	$NetBSD: aout_machdep.h,v 1.2 2006/07/03 17:01:45 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1992, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)exec.h	8.1 (Berkeley) 6/10/93
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	AOUT_LDPGSZ	16384
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										185
									
								
								StdLib/Include/Ipf/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										185
									
								
								StdLib/Include/Ipf/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,185 @@
 | 
			
		||||
/*	$NetBSD: asm.h,v 1.4 2006/08/30 11:14:23 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/* -
 | 
			
		||||
 * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
 | 
			
		||||
 * All Rights Reserved.
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission to use, copy, modify and distribute this software and its
 | 
			
		||||
 * documentation is hereby granted, provided that both the copyright
 | 
			
		||||
 * notice and this permission notice appear in all copies of the
 | 
			
		||||
 * software, derivative works or modified versions, and any portions
 | 
			
		||||
 * thereof, and that both notices appear in supporting documentation.
 | 
			
		||||
 * 
 | 
			
		||||
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 | 
			
		||||
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 | 
			
		||||
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 | 
			
		||||
 * 
 | 
			
		||||
 * Carnegie Mellon requests users of this software to return to
 | 
			
		||||
 * 
 | 
			
		||||
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 | 
			
		||||
 *  School of Computer Science
 | 
			
		||||
 *  Carnegie Mellon University
 | 
			
		||||
 *  Pittsburgh PA 15213-3890
 | 
			
		||||
 * 
 | 
			
		||||
 * any improvements or extensions that they make and grant Carnegie Mellon
 | 
			
		||||
 * the rights to redistribute these changes.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	Assembly coding style
 | 
			
		||||
 *
 | 
			
		||||
 *	This file contains macros and register defines to
 | 
			
		||||
 *	aid in writing more readable assembly code.
 | 
			
		||||
 *	Some rules to make assembly code understandable by
 | 
			
		||||
 *	a debugger are also noted.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Macro to make a local label name.
 | 
			
		||||
 */
 | 
			
		||||
#define	LLABEL(name,num)	L ## name ## num
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * MCOUNT
 | 
			
		||||
 */
 | 
			
		||||
#if defined(GPROF)
 | 
			
		||||
#define	MCOUNT					\
 | 
			
		||||
	alloc	out0 = ar.pfs, 8, 0, 4, 0;	\
 | 
			
		||||
	mov	out1 = r1;			\
 | 
			
		||||
	mov	out2 = b0;;			\
 | 
			
		||||
	mov	out3 = r0;			\
 | 
			
		||||
	br.call.sptk b0 = _mcount;;
 | 
			
		||||
#else
 | 
			
		||||
#define	MCOUNT	/* nothing */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ENTRY
 | 
			
		||||
 *	Declare a global leaf function.
 | 
			
		||||
 *	A leaf function does not call other functions.
 | 
			
		||||
 */
 | 
			
		||||
#define	ENTRY(_name_, _n_args_)			\
 | 
			
		||||
	.global	_name_;				\
 | 
			
		||||
	.align	16;				\
 | 
			
		||||
	.proc	_name_;				\
 | 
			
		||||
_name_:;					\
 | 
			
		||||
	.regstk	_n_args_, 0, 0, 0;		\
 | 
			
		||||
	MCOUNT
 | 
			
		||||
 | 
			
		||||
#define	ENTRY_NOPROFILE(_name_, _n_args_)	\
 | 
			
		||||
	.global	_name_;				\
 | 
			
		||||
	.align	16;				\
 | 
			
		||||
	.proc	_name_;				\
 | 
			
		||||
_name_:;					\
 | 
			
		||||
	.regstk	_n_args_, 0, 0, 0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * STATIC_ENTRY
 | 
			
		||||
 *	Declare a local leaf function.
 | 
			
		||||
 */
 | 
			
		||||
#define STATIC_ENTRY(_name_, _n_args_)		\
 | 
			
		||||
	.align	16;				\
 | 
			
		||||
	.proc	_name_;				\
 | 
			
		||||
_name_:;					\
 | 
			
		||||
	.regstk	_n_args_, 0, 0, 0		\
 | 
			
		||||
	MCOUNT
 | 
			
		||||
/*
 | 
			
		||||
 * XENTRY
 | 
			
		||||
 *	Global alias for a leaf function, or alternate entry point
 | 
			
		||||
 */
 | 
			
		||||
#define	XENTRY(_name_)				\
 | 
			
		||||
	.globl	_name_;				\
 | 
			
		||||
_name_:
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * STATIC_XENTRY
 | 
			
		||||
 *	Local alias for a leaf function, or alternate entry point
 | 
			
		||||
 */
 | 
			
		||||
#define	STATIC_XENTRY(_name_)			\
 | 
			
		||||
_name_:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * END
 | 
			
		||||
 *	Function delimiter
 | 
			
		||||
 */
 | 
			
		||||
#define	END(_name_)						\
 | 
			
		||||
	.endp	_name_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * EXPORT
 | 
			
		||||
 *	Export a symbol
 | 
			
		||||
 */
 | 
			
		||||
#define	EXPORT(_name_)						\
 | 
			
		||||
	.global	_name_;						\
 | 
			
		||||
_name_:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IMPORT
 | 
			
		||||
 *	Make an external name visible, typecheck the size
 | 
			
		||||
 */
 | 
			
		||||
#define	IMPORT(_name_, _size_)					\
 | 
			
		||||
	/* .extern	_name_,_size_ */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ABS
 | 
			
		||||
 *	Define an absolute symbol
 | 
			
		||||
 */
 | 
			
		||||
#define	ABS(_name_, _value_)					\
 | 
			
		||||
	.globl	_name_;						\
 | 
			
		||||
_name_	=	_value_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * BSS
 | 
			
		||||
 *	Allocate un-initialized space for a global symbol
 | 
			
		||||
 */
 | 
			
		||||
#define	BSS(_name_,_numbytes_)					\
 | 
			
		||||
	.comm	_name_,_numbytes_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * MSG
 | 
			
		||||
 *	Allocate space for a message (a read-only ascii string)
 | 
			
		||||
 */
 | 
			
		||||
#define	ASCIZ	.asciz
 | 
			
		||||
#define	MSG(msg,reg,label)			\
 | 
			
		||||
	addl reg,@ltoff(label),gp;;		\
 | 
			
		||||
	ld8 reg=[reg];;				\
 | 
			
		||||
	.data;					\
 | 
			
		||||
label:	ASCIZ msg;				\
 | 
			
		||||
	.text;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * System call glue.
 | 
			
		||||
 */
 | 
			
		||||
#define	SYSCALLNUM(name)	___CONCAT(SYS_,name)
 | 
			
		||||
 | 
			
		||||
#define	CALLSYS_NOERROR(name)					\
 | 
			
		||||
{	.mmi ;							\
 | 
			
		||||
	alloc		r9 = ar.pfs, 0, 0, 8, 0 ;		\
 | 
			
		||||
	mov		r31 = ar.k5 ;				\
 | 
			
		||||
	mov		r10 = b0 ;; }				\
 | 
			
		||||
{	.mib ;							\
 | 
			
		||||
	mov		r8 = SYSCALLNUM(name) ;			\
 | 
			
		||||
	mov		b7 = r31 ; 				\
 | 
			
		||||
	br.call.sptk	b0 = b7 ;; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * WEAK_ALIAS: create a weak alias (ELF only).
 | 
			
		||||
 */
 | 
			
		||||
#define WEAK_ALIAS(alias,sym)					\
 | 
			
		||||
	.weak alias;						\
 | 
			
		||||
	alias = sym
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * STRONG_ALIAS: create a strong alias.
 | 
			
		||||
 */
 | 
			
		||||
#define STRONG_ALIAS(alias,sym)					\
 | 
			
		||||
	.globl alias;						\
 | 
			
		||||
	alias = sym
 | 
			
		||||
							
								
								
									
										52
									
								
								StdLib/Include/Ipf/machine/bootinfo.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								StdLib/Include/Ipf/machine/bootinfo.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
/*	$NetBSD: bootinfo.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Chris G. Demetriou
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission to use, copy, modify and distribute this software and
 | 
			
		||||
 * its documentation is hereby granted, provided that both the copyright
 | 
			
		||||
 * notice and this permission notice appear in all copies of the
 | 
			
		||||
 * software, derivative works or modified versions, and any portions
 | 
			
		||||
 * thereof, and that both notices appear in supporting documentation.
 | 
			
		||||
 * 
 | 
			
		||||
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 
 | 
			
		||||
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 
 | 
			
		||||
 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 | 
			
		||||
 * 
 | 
			
		||||
 * Carnegie Mellon requests users of this software to return to
 | 
			
		||||
 *
 | 
			
		||||
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 | 
			
		||||
 *  School of Computer Science
 | 
			
		||||
 *  Carnegie Mellon University
 | 
			
		||||
 *  Pittsburgh PA 15213-3890
 | 
			
		||||
 *
 | 
			
		||||
 * any improvements or extensions that they make and grant Carnegie the
 | 
			
		||||
 * rights to redistribute these changes.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct bootinfo {
 | 
			
		||||
	uint64_t	bi_magic;		/* BOOTINFO_MAGIC */
 | 
			
		||||
#define	BOOTINFO_MAGIC		0xdeadbeeffeedface
 | 
			
		||||
	uint64_t	bi_version;		/* version 1 */
 | 
			
		||||
	uint64_t	bi_spare[5];		/* was: name of booted kernel */
 | 
			
		||||
	uint64_t	bi_hcdp;		/* DIG64 HCDP table */
 | 
			
		||||
	uint64_t	bi_fpswa;		/* FPSWA interface */
 | 
			
		||||
	uint64_t	bi_boothowto;		/* value for boothowto */
 | 
			
		||||
	uint64_t	bi_systab;		/* pa of EFI system table */
 | 
			
		||||
	uint64_t	bi_memmap;		/* pa of EFI memory map */
 | 
			
		||||
	uint64_t	bi_memmap_size;		/* size of EFI memory map */
 | 
			
		||||
	uint64_t	bi_memdesc_size;	/* sizeof EFI memory desc */
 | 
			
		||||
	uint32_t	bi_memdesc_version;	/* EFI memory desc version */
 | 
			
		||||
	uint32_t	bi_spare2;
 | 
			
		||||
	uint64_t	bi_unwindtab;		/* start of ia64 unwind table */
 | 
			
		||||
	uint64_t	bi_unwindtablen;	/* lenght of the table, in bytes */
 | 
			
		||||
	uint64_t	bi_symtab;		/* start of kernel sym table */
 | 
			
		||||
	uint64_t	bi_esymtab;		/* end of kernel sym table */
 | 
			
		||||
	uint64_t	bi_kernend;		/* end of kernel space */
 | 
			
		||||
	uint64_t	bi_envp;		/* environment */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern struct bootinfo bootinfo;
 | 
			
		||||
							
								
								
									
										8
									
								
								StdLib/Include/Ipf/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								StdLib/Include/Ipf/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
			
		||||
/*      $NetBSD: bswap.h,v 1.1 2006/04/07 14:21:18 cherry Exp $      */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_BSWAP_H_
 | 
			
		||||
#define	_MACHINE_BSWAP_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/bswap.h>
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_BSWAP_H_ */
 | 
			
		||||
							
								
								
									
										11
									
								
								StdLib/Include/Ipf/machine/cdefs.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								StdLib/Include/Ipf/machine/cdefs.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
/*	$NetBSD: cdefs.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
#ifndef	_MACHINE_CDEFS_H_
 | 
			
		||||
#define	_MACHINE_CDEFS_H_
 | 
			
		||||
 | 
			
		||||
/* We're elf only: inspected by sys/cdefs.h  */
 | 
			
		||||
#ifndef __ELF__
 | 
			
		||||
#define __ELF__
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_CDEFS_H_ */
 | 
			
		||||
							
								
								
									
										180
									
								
								StdLib/Include/Ipf/machine/cpu.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										180
									
								
								StdLib/Include/Ipf/machine/cpu.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,180 @@
 | 
			
		||||
/*	$NetBSD: cpu.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2006 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 | 
			
		||||
 * NASA Ames Research Center, and by Charles M. Hannum.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by the NetBSD
 | 
			
		||||
 *	Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1988 University of Utah.
 | 
			
		||||
 * Copyright (c) 1982, 1990, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * the Systems Programming Group of the University of Utah Computer
 | 
			
		||||
 * Science Department.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 4. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * from: Utah $Hdr: cpu.h 1.16 91/03/25$
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)cpu.h	8.4 (Berkeley) 1/5/94
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_CPU_H_
 | 
			
		||||
#define _IA64_CPU_H_
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
#include <sys/cpu_data.h>
 | 
			
		||||
#include <sys/cc_microtime.h>
 | 
			
		||||
#include <machine/frame.h>
 | 
			
		||||
#include <machine/ia64_cpu.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct cpu_info {
 | 
			
		||||
	struct device *ci_dev;		/* pointer to our device */
 | 
			
		||||
	struct cpu_info *ci_self;	/* self-pointer */
 | 
			
		||||
	/*
 | 
			
		||||
	 * Public members.
 | 
			
		||||
	 */
 | 
			
		||||
	struct lwp *ci_curlwp;		/* current owner of the processor */
 | 
			
		||||
	struct cpu_data ci_data;	/* MI per-cpu data */
 | 
			
		||||
	struct cc_microtime_state ci_cc;/* cc_microtime state */
 | 
			
		||||
	struct cpu_info *ci_next;	/* next cpu_info structure */
 | 
			
		||||
 | 
			
		||||
	/* XXX: Todo */
 | 
			
		||||
	/*
 | 
			
		||||
	 * Private members.
 | 
			
		||||
	 */
 | 
			
		||||
	cpuid_t ci_cpuid;		/* our CPU ID */
 | 
			
		||||
	struct pmap *ci_pmap;		/* current pmap */
 | 
			
		||||
	struct lwp *ci_fpcurlwp;	/* current owner of the FPU */
 | 
			
		||||
	paddr_t ci_curpcb;		/* PA of current HW PCB */
 | 
			
		||||
	struct pcb *ci_idle_pcb;	/* our idle PCB */
 | 
			
		||||
	struct cpu_softc *ci_softc;	/* pointer to our device */
 | 
			
		||||
	u_long ci_want_resched;		/* preempt current process */
 | 
			
		||||
	u_long ci_intrdepth;		/* interrupt trap depth */
 | 
			
		||||
	struct trapframe *ci_db_regs;	/* registers for debuggers */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern struct cpu_info cpu_info_primary;
 | 
			
		||||
 | 
			
		||||
#ifdef MULTIPROCESSOR
 | 
			
		||||
/* XXX: TODO */
 | 
			
		||||
#else
 | 
			
		||||
#define	curcpu() (&cpu_info_primary)
 | 
			
		||||
#endif /* MULTIPROCESSOR */
 | 
			
		||||
 | 
			
		||||
#define cpu_number() 0              /*XXX: FIXME */
 | 
			
		||||
 | 
			
		||||
#define aston(p)		((p)->p_md.md_astpending = 1)
 | 
			
		||||
 | 
			
		||||
#define	need_resched(ci)            /*XXX: FIXME */
 | 
			
		||||
 | 
			
		||||
struct clockframe {
 | 
			
		||||
	struct trapframe cf_tf;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	CLKF_PC(cf)		((cf)->cf_tf.tf_special.iip)
 | 
			
		||||
#define	CLKF_CPL(cf)		((cf)->cf_tf.tf_special.psr & IA64_PSR_CPL)
 | 
			
		||||
#define	CLKF_USERMODE(cf)	(CLKF_CPL(cf) != IA64_PSR_CPL_KERN)
 | 
			
		||||
#define	CLKF_BASEPRI(frame)	(0) /*XXX: CHECKME */
 | 
			
		||||
#define	CLKF_INTR(frame)	(curcpu()->ci_intrdepth)
 | 
			
		||||
 | 
			
		||||
#define	TRAPF_PC(tf)		((tf)->tf_special.iip)
 | 
			
		||||
#define	TRAPF_CPL(tf)		((tf)->tf_special.psr & IA64_PSR_CPL)
 | 
			
		||||
#define	TRAPF_USERMODE(tf)	(TRAPF_CPL(tf) != IA64_PSR_CPL_KERN)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Give a profiling tick to the current process when the user profiling
 | 
			
		||||
 * buffer pages are invalid. XXX:Fixme.... On the ia64 I haven't yet figured 
 | 
			
		||||
 * out what to do about this.. XXX.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define	need_proftick(p)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Notify the current process (p) that it has a signal pending,
 | 
			
		||||
 * process as soon as possible.
 | 
			
		||||
 */
 | 
			
		||||
#define	signotify(p)		aston(p)
 | 
			
		||||
 | 
			
		||||
#define setsoftclock()              /*XXX: FIXME */
 | 
			
		||||
 | 
			
		||||
/* machdep.c */
 | 
			
		||||
int	cpu_maxproc(void); /*XXX: Fill in machdep.c */
 | 
			
		||||
 | 
			
		||||
#define	cpu_proc_fork(p1, p2) /* XXX: Look into this. */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* XXX: TODO: generic microtime support kern/kern_microtime.c 
 | 
			
		||||
 * #define microtime(tv)	cc_microtime(tv) 
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* _KERNEL_ */
 | 
			
		||||
#endif /* _IA64_CPU_H */
 | 
			
		||||
							
								
								
									
										78
									
								
								StdLib/Include/Ipf/machine/cpu_counter.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								StdLib/Include/Ipf/machine/cpu_counter.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,78 @@
 | 
			
		||||
/*	$NetBSD: cpu_counter.h,v 1.1 2006/09/20 13:33:04 kochi Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2006 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Takayoshi Kochi.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_CPU_COUNTER_H_
 | 
			
		||||
#define _IA64_CPU_COUNTER_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine-specific support for CPU counter.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
#include <machine/ia64_cpu.h>
 | 
			
		||||
 | 
			
		||||
static __inline int
 | 
			
		||||
cpu_hascounter(void)
 | 
			
		||||
{
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline uint64_t
 | 
			
		||||
cpu_counter(void)
 | 
			
		||||
{
 | 
			
		||||
	return ia64_get_itc();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline uint32_t
 | 
			
		||||
cpu_counter32(void)
 | 
			
		||||
{
 | 
			
		||||
	return (ia64_get_itc() & 0xffffffffUL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline uint64_t
 | 
			
		||||
cpu_frequency(struct cpu_info *ci)
 | 
			
		||||
{
 | 
			
		||||
	extern uint64_t itc_frequency;
 | 
			
		||||
 | 
			
		||||
	return itc_frequency;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_CPU_COUNTER_H_ */
 | 
			
		||||
							
								
								
									
										202
									
								
								StdLib/Include/Ipf/machine/db_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										202
									
								
								StdLib/Include/Ipf/machine/db_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,202 @@
 | 
			
		||||
/* $NetBSD: db_machdep.h,v 1.2 2006/08/30 11:12:04 cherry Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1995 Carnegie-Mellon University.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Chris G. Demetriou
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify and distribute this software and
 | 
			
		||||
 * its documentation is hereby granted, provided that both the copyright
 | 
			
		||||
 * notice and this permission notice appear in all copies of the
 | 
			
		||||
 * software, derivative works or modified versions, and any portions
 | 
			
		||||
 * thereof, and that both notices appear in supporting documentation.
 | 
			
		||||
 *
 | 
			
		||||
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 | 
			
		||||
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
 | 
			
		||||
 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 | 
			
		||||
 *
 | 
			
		||||
 * Carnegie Mellon requests users of this software to return to
 | 
			
		||||
 *
 | 
			
		||||
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 | 
			
		||||
 *  School of Computer Science
 | 
			
		||||
 *  Carnegie Mellon University
 | 
			
		||||
 *  Pittsburgh PA 15213-3890
 | 
			
		||||
 *
 | 
			
		||||
 * any improvements or extensions that they make and grant Carnegie the
 | 
			
		||||
 * rights to redistribute these changes.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_IA64_DB_MACHDEP_H_
 | 
			
		||||
#define	_IA64_DB_MACHDEP_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine-dependent defines for new kernel debugger.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <sys/lock.h>
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
#include <uvm/uvm_extern.h>
 | 
			
		||||
#include <machine/frame.h>
 | 
			
		||||
#include <machine/ia64_cpu.h>
 | 
			
		||||
 | 
			
		||||
typedef	vaddr_t		db_addr_t;	/* address - unsigned */
 | 
			
		||||
typedef	long		db_expr_t;	/* expression - signed */
 | 
			
		||||
 | 
			
		||||
typedef struct trapframe db_regs_t;
 | 
			
		||||
extern db_regs_t	*ddb_regp;	/* pointer to current register state */
 | 
			
		||||
#define	DDB_REGS	(ddb_regp)
 | 
			
		||||
 | 
			
		||||
#if 0	/* XXX: disabling this until we switch on makectx()and have a proper \
 | 
			
		||||
	   curlwp(). TODO: please switch this back on ASAP */
 | 
			
		||||
 | 
			
		||||
#define	PC_REGS(regs)	((db_addr_t)(regs)->tf_special.__spare == 0) ?	\
 | 
			
		||||
			((db_addr_t)(regs)->tf_special.rp) :		\
 | 
			
		||||
			((db_addr_t)(regs)->tf_special.iip + (((regs)->tf_special.psr>>41) & 3))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if 1
 | 
			
		||||
#define PC_REGS(regs)   ((db_addr_t)(regs)->tf_special.iip + (((regs)->tf_special.psr>>41) & 3))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define db_set_single_step(regs)	((regs)->tf_special.psr |= IA64_PSR_SS)
 | 
			
		||||
#define db_clear_single_step(regs)	((regs)->tf_special.psr &= ~IA64_PSR_SS)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* defines to help with manipulating ia64 VLIW instruction bundles and slots */
 | 
			
		||||
 | 
			
		||||
#define	TMPL_BITS	5
 | 
			
		||||
#define	TMPL_MASK	((1 << TMPL_BITS) - 1)
 | 
			
		||||
#define	SLOT_BITS	41
 | 
			
		||||
#define	SLOT_COUNT	3
 | 
			
		||||
#define	SLOT_MASK	((1ULL << SLOT_BITS) - 1ULL)
 | 
			
		||||
#define	SLOT_SHIFT(i)	(TMPL_BITS+((i)<<3)+(i))
 | 
			
		||||
 | 
			
		||||
#define ADDR_SLOT0(addr)	( (addr) & ~(0xFUL) )
 | 
			
		||||
#define SLOT_ADDR(addr)		( (addr) & (0xFUL) )
 | 
			
		||||
/* breakpoint address. 
 | 
			
		||||
 * Check for violations of pseudo offsets above 2. 
 | 
			
		||||
 * Adjust for 32 bit shift within Bundle.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	BKPT_ADDR(addr)	( (SLOT_ADDR(addr) < SLOT_COUNT) ? \
 | 
			
		||||
			  (ADDR_SLOT0(addr) | (SLOT_ADDR(addr) << 2))	\
 | 
			
		||||
			  : ADDR_SLOT0(addr) )
 | 
			
		||||
 | 
			
		||||
#define	BKPT_SIZE	8
 | 
			
		||||
 | 
			
		||||
#define	BKPT_SET(inst, addr)	db_bkpt_set(inst, addr)
 | 
			
		||||
db_expr_t db_bkpt_set(db_expr_t inst, db_addr_t addr);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define PC_ADVANCE(regs) db_pc_advance(regs)
 | 
			
		||||
void db_pc_advance(db_regs_t *);
 | 
			
		||||
 | 
			
		||||
#define	IS_BREAKPOINT_TRAP(type, code)	(type == IA64_VEC_BREAK)
 | 
			
		||||
#define	IS_WATCHPOINT_TRAP(type, code)	0
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define	inst_trap_return(ins)	(ins & 0)
 | 
			
		||||
#define	inst_return(ins)	(ins & 0)
 | 
			
		||||
#define	inst_call(ins)		(ins & 0)
 | 
			
		||||
#define	inst_branch(ins)	(ins & 0)
 | 
			
		||||
#define	inst_load(ins)		(ins & 0)
 | 
			
		||||
#define	inst_store(ins)		(ins & 0)
 | 
			
		||||
#define	inst_unconditional_flow_transfer(ins) (ins & 0)
 | 
			
		||||
 | 
			
		||||
#define	branch_taken(ins, pc, regs) pc
 | 
			
		||||
 | 
			
		||||
u_long	db_register_value(db_regs_t *, int);
 | 
			
		||||
int	ddb_trap(unsigned long, unsigned long, unsigned long,
 | 
			
		||||
	    unsigned long, struct trapframe *);
 | 
			
		||||
 | 
			
		||||
int ia64_trap(int, int, db_regs_t *); /* See: trap.c */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * We define some of our own commands.
 | 
			
		||||
 */
 | 
			
		||||
#define	DB_MACHINE_COMMANDS
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * We use Elf64 symbols in DDB.
 | 
			
		||||
 */
 | 
			
		||||
#define	DB_ELF_SYMBOLS
 | 
			
		||||
#define	DB_ELFSIZE	64
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Stuff for KGDB.
 | 
			
		||||
 */
 | 
			
		||||
typedef long		kgdb_reg_t;
 | 
			
		||||
#define	KGDB_NUMREGS	66	/* from tm-alpha.h, NUM_REGS */
 | 
			
		||||
#define	KGDB_REG_V0	0
 | 
			
		||||
#define	KGDB_REG_T0	1
 | 
			
		||||
#define	KGDB_REG_T1	2
 | 
			
		||||
#define	KGDB_REG_T2	3
 | 
			
		||||
#define	KGDB_REG_T3	4
 | 
			
		||||
#define	KGDB_REG_T4	5
 | 
			
		||||
#define	KGDB_REG_T5	6
 | 
			
		||||
#define	KGDB_REG_T6	7
 | 
			
		||||
#define	KGDB_REG_T7	8
 | 
			
		||||
#define	KGDB_REG_S0	9
 | 
			
		||||
#define	KGDB_REG_S1	10
 | 
			
		||||
#define	KGDB_REG_S2	11
 | 
			
		||||
#define	KGDB_REG_S3	12
 | 
			
		||||
#define	KGDB_REG_S4	13
 | 
			
		||||
#define	KGDB_REG_S5	14
 | 
			
		||||
#define	KGDB_REG_S6	15	/* FP */
 | 
			
		||||
#define	KGDB_REG_A0	16
 | 
			
		||||
#define	KGDB_REG_A1	17
 | 
			
		||||
#define	KGDB_REG_A2	18
 | 
			
		||||
#define	KGDB_REG_A3	19
 | 
			
		||||
#define	KGDB_REG_A4	20
 | 
			
		||||
#define	KGDB_REG_A5	21
 | 
			
		||||
#define	KGDB_REG_T8	22
 | 
			
		||||
#define	KGDB_REG_T9	23
 | 
			
		||||
#define	KGDB_REG_T10	24
 | 
			
		||||
#define	KGDB_REG_T11	25
 | 
			
		||||
#define	KGDB_REG_RA	26
 | 
			
		||||
#define	KGDB_REG_T12	27
 | 
			
		||||
#define	KGDB_REG_AT	28
 | 
			
		||||
#define	KGDB_REG_GP	29
 | 
			
		||||
#define	KGDB_REG_SP	30
 | 
			
		||||
#define	KGDB_REG_ZERO	31
 | 
			
		||||
#define	KGDB_REG_F0	32
 | 
			
		||||
#define	KGDB_REG_F1	33
 | 
			
		||||
#define	KGDB_REG_F2	34
 | 
			
		||||
#define	KGDB_REG_F3	35
 | 
			
		||||
#define	KGDB_REG_F4	36
 | 
			
		||||
#define	KGDB_REG_F5	37
 | 
			
		||||
#define	KGDB_REG_F6	38
 | 
			
		||||
#define	KGDB_REG_F7	39
 | 
			
		||||
#define	KGDB_REG_F8	40
 | 
			
		||||
#define	KGDB_REG_F9	41
 | 
			
		||||
#define	KGDB_REG_F10	42
 | 
			
		||||
#define	KGDB_REG_F11	43
 | 
			
		||||
#define	KGDB_REG_F12	44
 | 
			
		||||
#define	KGDB_REG_F13	45
 | 
			
		||||
#define	KGDB_REG_F14	46
 | 
			
		||||
#define	KGDB_REG_F15	47
 | 
			
		||||
#define	KGDB_REG_F16	48
 | 
			
		||||
#define	KGDB_REG_F17	49
 | 
			
		||||
#define	KGDB_REG_F18	50
 | 
			
		||||
#define	KGDB_REG_F19	51
 | 
			
		||||
#define	KGDB_REG_F20	52
 | 
			
		||||
#define	KGDB_REG_F21	53
 | 
			
		||||
#define	KGDB_REG_F22	54
 | 
			
		||||
#define	KGDB_REG_F23	55
 | 
			
		||||
#define	KGDB_REG_F24	56
 | 
			
		||||
#define	KGDB_REG_F25	57
 | 
			
		||||
#define	KGDB_REG_F26	58
 | 
			
		||||
#define	KGDB_REG_F27	59
 | 
			
		||||
#define	KGDB_REG_F28	60
 | 
			
		||||
#define	KGDB_REG_F29	61
 | 
			
		||||
#define	KGDB_REG_F30	62
 | 
			
		||||
#define	KGDB_REG_F31	63
 | 
			
		||||
#define	KGDB_REG_PC	64
 | 
			
		||||
#define	KGDB_REG_VFP	65
 | 
			
		||||
 | 
			
		||||
/* Too much?  Must be large enough for register transfer. */
 | 
			
		||||
#define	KGDB_BUFLEN	1024
 | 
			
		||||
 | 
			
		||||
#endif	/* _IA64_DB_MACHDEP_H_ */
 | 
			
		||||
							
								
								
									
										92
									
								
								StdLib/Include/Ipf/machine/dig64.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								StdLib/Include/Ipf/machine/dig64.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,92 @@
 | 
			
		||||
/*	$NetBSD: dig64.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2002 Marcel Moolenaar
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_DIG64_H_
 | 
			
		||||
#define	_MACHINE_DIG64_H_
 | 
			
		||||
 | 
			
		||||
struct dig64_gas {
 | 
			
		||||
	uint8_t		addr_space;
 | 
			
		||||
	uint8_t		bit_width;
 | 
			
		||||
	uint8_t		bit_offset;
 | 
			
		||||
	uint8_t		_reserved_;
 | 
			
		||||
	/*
 | 
			
		||||
	 * XXX using a 64-bit type for the address would cause padding and
 | 
			
		||||
	 * using __packed would cause unaligned accesses...
 | 
			
		||||
	 */
 | 
			
		||||
	uint32_t	addr_low;
 | 
			
		||||
	uint32_t	addr_high;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct dig64_hcdp_entry {
 | 
			
		||||
	uint8_t		type;
 | 
			
		||||
#define	DIG64_HCDP_CONSOLE	0
 | 
			
		||||
#define	DIG64_HCDP_DBGPORT	1
 | 
			
		||||
	uint8_t		databits;
 | 
			
		||||
	uint8_t		parity;
 | 
			
		||||
	uint8_t		stopbits;
 | 
			
		||||
	uint8_t		pci_segment;
 | 
			
		||||
	uint8_t		pci_bus;
 | 
			
		||||
	uint8_t		pci_device:5;
 | 
			
		||||
	uint8_t		_reserved1_:3;
 | 
			
		||||
	uint8_t		pci_function:3;
 | 
			
		||||
	uint8_t		_reserved2_:3;
 | 
			
		||||
	uint8_t		interrupt:1;
 | 
			
		||||
	uint8_t		pci_flag:1;
 | 
			
		||||
	/*
 | 
			
		||||
	 * XXX using a 64-bit type for the baudrate would cause padding and
 | 
			
		||||
	 * using __packed would cause unaligned accesses...
 | 
			
		||||
	 */
 | 
			
		||||
	uint32_t	baud_low;
 | 
			
		||||
	uint32_t	baud_high;
 | 
			
		||||
	struct dig64_gas address;
 | 
			
		||||
	uint16_t	pci_devid;
 | 
			
		||||
	uint16_t	pci_vendor;
 | 
			
		||||
	uint32_t	irq;
 | 
			
		||||
	uint32_t	pclock;
 | 
			
		||||
	uint8_t		pci_interface;
 | 
			
		||||
	uint8_t		_reserved3_[7];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct dig64_hcdp_table {
 | 
			
		||||
	char		signature[4];
 | 
			
		||||
#define	HCDP_SIGNATURE	"HCDP"
 | 
			
		||||
	uint32_t	length;
 | 
			
		||||
	uint8_t		revision;
 | 
			
		||||
	uint8_t		checksum;
 | 
			
		||||
	char		oem_id[6];
 | 
			
		||||
	char		oem_tbl_id[8];
 | 
			
		||||
	uint32_t	oem_rev;
 | 
			
		||||
	char		creator_id[4];
 | 
			
		||||
	uint32_t	creator_rev;
 | 
			
		||||
	uint32_t	entries;
 | 
			
		||||
	struct dig64_hcdp_entry entry[1];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										73
									
								
								StdLib/Include/Ipf/machine/disklabel.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								StdLib/Include/Ipf/machine/disklabel.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,73 @@
 | 
			
		||||
/*	$NetBSD: disklabel.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1994 Christopher G. Demetriou
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *      This product includes software developed by Christopher G. Demetriou.
 | 
			
		||||
 * 4. The name of the author may not be used to endorse or promote products
 | 
			
		||||
 *    derived from this software without specific prior written permission
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_DISKLABEL_H_
 | 
			
		||||
#define _MACHINE_DISKLABEL_H_
 | 
			
		||||
 | 
			
		||||
#define	LABELSECTOR		1	/* sector containing label */
 | 
			
		||||
#define	LABELOFFSET		0	/* offset of label in sector */
 | 
			
		||||
#define	MAXPARTITIONS		16	/* number of partitions */
 | 
			
		||||
#define	OLDMAXPARTITIONS 	8	/* number of partitions before 1.6 */
 | 
			
		||||
#define	RAW_PART		3	/* raw partition: XX?d (XXX) */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * We use the highest bit of the minor number for the partition number.
 | 
			
		||||
 * This maintains backward compatibility with device nodes created before
 | 
			
		||||
 * MAXPARTITIONS was increased.
 | 
			
		||||
 */
 | 
			
		||||
#define __I386_MAXDISKS	((1 << 20) / MAXPARTITIONS)
 | 
			
		||||
#define DISKUNIT(dev)	((minor(dev) / OLDMAXPARTITIONS) % __I386_MAXDISKS)
 | 
			
		||||
#define DISKPART(dev)	((minor(dev) % OLDMAXPARTITIONS) + \
 | 
			
		||||
    ((minor(dev) / (__I386_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
 | 
			
		||||
#define	DISKMINOR(unit, part) \
 | 
			
		||||
    (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
 | 
			
		||||
     ((part) / OLDMAXPARTITIONS) * (__I386_MAXDISKS * OLDMAXPARTITIONS))
 | 
			
		||||
 | 
			
		||||
/* Pull in MBR partition definitions. */
 | 
			
		||||
#if HAVE_NBTOOL_CONFIG_H
 | 
			
		||||
#include <nbinclude/sys/bootblock.h>
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/bootblock.h>
 | 
			
		||||
#endif /* HAVE_NBTOOL_CONFIG_H */
 | 
			
		||||
 | 
			
		||||
#ifndef __ASSEMBLER__
 | 
			
		||||
#if HAVE_NBTOOL_CONFIG_H
 | 
			
		||||
#include <nbinclude/sys/dkbad.h>
 | 
			
		||||
#else
 | 
			
		||||
#include <sys/dkbad.h>
 | 
			
		||||
#endif /* HAVE_NBTOOL_CONFIG_H */
 | 
			
		||||
struct cpu_disklabel {
 | 
			
		||||
	struct dkbad bad;
 | 
			
		||||
};
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_DISKLABEL_H_ */
 | 
			
		||||
							
								
								
									
										165
									
								
								StdLib/Include/Ipf/machine/efi.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										165
									
								
								StdLib/Include/Ipf/machine/efi.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,165 @@
 | 
			
		||||
/*	$NetBSD: efi.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2004 Marcel Moolenaar
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_EFI_H_
 | 
			
		||||
#define _MACHINE_EFI_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/uuid.h>
 | 
			
		||||
 | 
			
		||||
#define	EFI_PAGE_SHIFT		12
 | 
			
		||||
#define	EFI_PAGE_SIZE		(1 << EFI_PAGE_SHIFT)
 | 
			
		||||
#define	EFI_PAGE_MASK		(EFI_PAGE_SIZE - 1)
 | 
			
		||||
 | 
			
		||||
#define	EFI_TABLE_ACPI20			\
 | 
			
		||||
	{0x8868e871,0xe4f1,0x11d3,0xbc,0x22,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	EFI_TABLE_SAL				\
 | 
			
		||||
	{0xeb9d2d32,0x2d88,0x11d3,0x9a,0x16,{0x00,0x90,0x27,0x3f,0xc1,0x4d}}
 | 
			
		||||
 | 
			
		||||
enum efi_reset {
 | 
			
		||||
	EFI_RESET_COLD,
 | 
			
		||||
	EFI_RESET_WARM
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef uint16_t	efi_char;
 | 
			
		||||
typedef unsigned long efi_status;
 | 
			
		||||
 | 
			
		||||
struct efi_cfgtbl {
 | 
			
		||||
	struct uuid	ct_uuid;
 | 
			
		||||
	uint64_t	ct_data;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_md {
 | 
			
		||||
	uint32_t	md_type;
 | 
			
		||||
#define	EFI_MD_TYPE_NULL	0
 | 
			
		||||
#define	EFI_MD_TYPE_CODE	1	/* Loader text. */
 | 
			
		||||
#define	EFI_MD_TYPE_DATA	2	/* Loader data. */
 | 
			
		||||
#define	EFI_MD_TYPE_BS_CODE	3	/* Boot services text. */
 | 
			
		||||
#define	EFI_MD_TYPE_BS_DATA	4	/* Boot services data. */
 | 
			
		||||
#define	EFI_MD_TYPE_RT_CODE	5	/* Runtime services text. */
 | 
			
		||||
#define	EFI_MD_TYPE_RT_DATA	6	/* Runtime services data. */
 | 
			
		||||
#define	EFI_MD_TYPE_FREE	7	/* Unused/free memory. */
 | 
			
		||||
#define	EFI_MD_TYPE_BAD		8	/* Bad memory */
 | 
			
		||||
#define	EFI_MD_TYPE_RECLAIM	9	/* ACPI reclaimable memory. */
 | 
			
		||||
#define	EFI_MD_TYPE_FIRMWARE	10	/* ACPI NV memory */
 | 
			
		||||
#define	EFI_MD_TYPE_IOMEM	11	/* Memory-mapped I/O. */
 | 
			
		||||
#define	EFI_MD_TYPE_IOPORT	12	/* I/O port space. */
 | 
			
		||||
#define	EFI_MD_TYPE_PALCODE	13	/* PAL */
 | 
			
		||||
	uint32_t	__pad;
 | 
			
		||||
	uint64_t	md_phys;
 | 
			
		||||
	void		*md_virt;
 | 
			
		||||
	uint64_t	md_pages;
 | 
			
		||||
	uint64_t	md_attr;
 | 
			
		||||
#define	EFI_MD_ATTR_UC		0x0000000000000001UL
 | 
			
		||||
#define	EFI_MD_ATTR_WC		0x0000000000000002UL
 | 
			
		||||
#define	EFI_MD_ATTR_WT		0x0000000000000004UL
 | 
			
		||||
#define	EFI_MD_ATTR_WB		0x0000000000000008UL
 | 
			
		||||
#define	EFI_MD_ATTR_UCE		0x0000000000000010UL
 | 
			
		||||
#define	EFI_MD_ATTR_WP		0x0000000000001000UL
 | 
			
		||||
#define	EFI_MD_ATTR_RP		0x0000000000002000UL
 | 
			
		||||
#define	EFI_MD_ATTR_XP		0x0000000000004000UL
 | 
			
		||||
#define	EFI_MD_ATTR_RT		0x8000000000000000UL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_tm {
 | 
			
		||||
	uint16_t	tm_year;		/* 1998 - 20XX */
 | 
			
		||||
	uint8_t		tm_mon;			/* 1 - 12 */
 | 
			
		||||
	uint8_t		tm_mday;		/* 1 - 31 */
 | 
			
		||||
	uint8_t		tm_hour;		/* 0 - 23 */
 | 
			
		||||
	uint8_t		tm_min;			/* 0 - 59 */
 | 
			
		||||
	uint8_t		tm_sec;			/* 0 - 59 */
 | 
			
		||||
	uint8_t		__pad1;
 | 
			
		||||
	uint32_t	tm_nsec;		/* 0 - 999,999,999 */
 | 
			
		||||
	int16_t		tm_tz;			/* -1440 to 1440 or 2047 */
 | 
			
		||||
	uint8_t		tm_dst;
 | 
			
		||||
	uint8_t		__pad2;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_tmcap {
 | 
			
		||||
	uint32_t	tc_res;		/* 1e-6 parts per million */
 | 
			
		||||
	uint32_t	tc_prec;	/* hertz */
 | 
			
		||||
	uint8_t		tc_stz;		/* Set clears sub-second time */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_tblhdr {
 | 
			
		||||
	uint64_t	th_sig;
 | 
			
		||||
	uint32_t	th_rev;
 | 
			
		||||
	uint32_t	th_hdrsz;
 | 
			
		||||
	uint32_t	th_crc32;
 | 
			
		||||
	uint32_t	__res;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_rt {
 | 
			
		||||
	struct efi_tblhdr rt_hdr;
 | 
			
		||||
	efi_status	(*rt_gettime)(struct efi_tm *, struct efi_tmcap *);
 | 
			
		||||
	efi_status	(*rt_settime)(struct efi_tm *);
 | 
			
		||||
	efi_status	(*rt_getwaketime)(uint8_t *, uint8_t *,
 | 
			
		||||
	    struct efi_tm *);
 | 
			
		||||
	efi_status	(*rt_setwaketime)(uint8_t, struct efi_tm *);
 | 
			
		||||
	efi_status	(*rt_setvirtual)(u_long, u_long, uint32_t,
 | 
			
		||||
	    struct efi_md *);
 | 
			
		||||
	efi_status	(*rt_cvtptr)(u_long, void **);
 | 
			
		||||
	efi_status	(*rt_getvar)(efi_char *, struct uuid *, uint32_t *,
 | 
			
		||||
	    u_long *, void *);
 | 
			
		||||
	efi_status	(*rt_scanvar)(u_long *, efi_char *, struct uuid *);
 | 
			
		||||
	efi_status	(*rt_setvar)(efi_char *, struct uuid *, uint32_t,
 | 
			
		||||
	    u_long, void *);
 | 
			
		||||
	efi_status	(*rt_gethicnt)(uint32_t *);
 | 
			
		||||
	efi_status	(*rt_reset)(enum efi_reset, efi_status, u_long,
 | 
			
		||||
	    efi_char *);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct efi_systbl {
 | 
			
		||||
	struct efi_tblhdr st_hdr;
 | 
			
		||||
#define	EFI_SYSTBL_SIG	0x5453595320494249UL
 | 
			
		||||
	efi_char	*st_fwvendor;
 | 
			
		||||
	uint32_t	st_fwrev;
 | 
			
		||||
	uint32_t	__pad;
 | 
			
		||||
	void		*st_cin;
 | 
			
		||||
	void		*st_cinif;
 | 
			
		||||
	void		*st_cout;
 | 
			
		||||
	void		*st_coutif;
 | 
			
		||||
	void		*st_cerr;
 | 
			
		||||
	void		*st_cerrif;
 | 
			
		||||
	uint64_t	st_rt;
 | 
			
		||||
	void		*st_bs;
 | 
			
		||||
	u_long		st_entries;
 | 
			
		||||
	uint64_t	st_cfgtbl;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void efi_boot_finish(void);
 | 
			
		||||
int efi_boot_minimal(uint64_t);
 | 
			
		||||
void *efi_get_table(struct uuid *);
 | 
			
		||||
void efi_get_time(struct efi_tm *);
 | 
			
		||||
struct efi_md *efi_md_first(void);
 | 
			
		||||
struct efi_md *efi_md_next(struct efi_md *);
 | 
			
		||||
void efi_reset_system(void);
 | 
			
		||||
efi_status efi_set_time(struct efi_tm *);
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_EFI_H_ */
 | 
			
		||||
							
								
								
									
										150
									
								
								StdLib/Include/Ipf/machine/elf_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										150
									
								
								StdLib/Include/Ipf/machine/elf_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,150 @@
 | 
			
		||||
/*        $NetBSD */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1996-1997 John D. Polstra.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/elf.h,v 1.11 2003/09/25 01:10:24 peter Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define	ELF32_MACHDEP_ENDIANNESS	XXX	/* break compilation */
 | 
			
		||||
#define	ELF32_MACHDEP_ID_CASES						\
 | 
			
		||||
		/* no 32-bit ELF machine types supported until 32bit emu */
 | 
			
		||||
 | 
			
		||||
#define	ELF64_MACHDEP_ENDIANNESS	ELFDATA2LSB
 | 
			
		||||
#define	ELF64_MACHDEP_ID_CASES						\
 | 
			
		||||
		case EM_IA_64:						\
 | 
			
		||||
			break;
 | 
			
		||||
 | 
			
		||||
#define	ELF64_MACHDEP_ID	EM_IA_64	/* XXX */
 | 
			
		||||
 | 
			
		||||
#define ARCH_ELFSIZE		64	/* MD native binary size */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Relocation types.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*	Name			Value	   Field	Calculation */
 | 
			
		||||
#define	R_IA64_NONE		0	/* None */
 | 
			
		||||
#define	R_IA64_IMM14		0x21	/* immediate14	S + A */
 | 
			
		||||
#define	R_IA64_IMM22		0x22	/* immediate22	S + A */
 | 
			
		||||
#define	R_IA64_IMM64		0x23	/* immediate64	S + A */
 | 
			
		||||
#define	R_IA64_DIR32MSB		0x24	/* word32 MSB	S + A */
 | 
			
		||||
#define	R_IA64_DIR32LSB		0x25	/* word32 LSB	S + A */
 | 
			
		||||
#define	R_IA64_DIR64MSB		0x26	/* word64 MSB	S + A */
 | 
			
		||||
#define	R_IA64_DIR64LSB		0x27	/* word64 LSB	S + A */
 | 
			
		||||
#define	R_IA64_GPREL22		0x2a	/* immediate22	@gprel(S + A) */
 | 
			
		||||
#define	R_IA64_GPREL64I		0x2b	/* immediate64	@gprel(S + A) */
 | 
			
		||||
#define	R_IA64_GPREL64MSB	0x2e	/* word64 MSB	@gprel(S + A) */
 | 
			
		||||
#define	R_IA64_GPREL64LSB	0x2f	/* word64 LSB	@gprel(S + A) */
 | 
			
		||||
#define	R_IA64_LTOFF22		0x32	/* immediate22	@ltoff(S + A) */
 | 
			
		||||
#define	R_IA64_LTOFF64I		0x33	/* immediate64	@ltoff(S + A) */
 | 
			
		||||
#define	R_IA64_PLTOFF22		0x3a	/* immediate22	@pltoff(S + A) */
 | 
			
		||||
#define	R_IA64_PLTOFF64I	0x3b	/* immediate64	@pltoff(S + A) */
 | 
			
		||||
#define	R_IA64_PLTOFF64MSB	0x3e	/* word64 MSB	@pltoff(S + A) */
 | 
			
		||||
#define	R_IA64_PLTOFF64LSB	0x3f	/* word64 LSB	@pltoff(S + A) */
 | 
			
		||||
#define	R_IA64_FPTR64I		0x43	/* immediate64	@fptr(S + A) */
 | 
			
		||||
#define	R_IA64_FPTR32MSB	0x44	/* word32 MSB	@fptr(S + A) */
 | 
			
		||||
#define	R_IA64_FPTR32LSB	0x45	/* word32 LSB	@fptr(S + A) */
 | 
			
		||||
#define	R_IA64_FPTR64MSB	0x46	/* word64 MSB	@fptr(S + A) */
 | 
			
		||||
#define	R_IA64_FPTR64LSB	0x47	/* word64 LSB	@fptr(S + A) */
 | 
			
		||||
#define	R_IA64_PCREL21B		0x49	/* immediate21 form1 S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL21M		0x4a	/* immediate21 form2 S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL21F		0x4b	/* immediate21 form3 S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL32MSB	0x4c	/* word32 MSB	S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL32LSB	0x4d	/* word32 LSB	S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL64MSB	0x4e	/* word64 MSB	S + A - P */
 | 
			
		||||
#define	R_IA64_PCREL64LSB	0x4f	/* word64 LSB	S + A - P */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR22	0x52	/* immediate22	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR64I	0x53	/* immediate64	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR32MSB	0x54	/* word32 MSB	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR32LSB	0x55	/* word32 LSB	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR64MSB	0x56	/* word64 MSB	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_LTOFF_FPTR64LSB	0x57	/* word64 LSB	@ltoff(@fptr(S + A)) */
 | 
			
		||||
#define	R_IA64_SEGREL32MSB	0x5c	/* word32 MSB	@segrel(S + A) */
 | 
			
		||||
#define	R_IA64_SEGREL32LSB	0x5d	/* word32 LSB	@segrel(S + A) */
 | 
			
		||||
#define	R_IA64_SEGREL64MSB	0x5e	/* word64 MSB	@segrel(S + A) */
 | 
			
		||||
#define	R_IA64_SEGREL64LSB	0x5f	/* word64 LSB	@segrel(S + A) */
 | 
			
		||||
#define	R_IA64_SECREL32MSB	0x64	/* word32 MSB	@secrel(S + A) */
 | 
			
		||||
#define	R_IA64_SECREL32LSB	0x65	/* word32 LSB	@secrel(S + A) */
 | 
			
		||||
#define	R_IA64_SECREL64MSB	0x66	/* word64 MSB	@secrel(S + A) */
 | 
			
		||||
#define	R_IA64_SECREL64LSB	0x67	/* word64 LSB	@secrel(S + A) */
 | 
			
		||||
#define	R_IA64_REL32MSB		0x6c	/* word32 MSB	BD + A */
 | 
			
		||||
#define	R_IA64_REL32LSB		0x6d	/* word32 LSB	BD + A */
 | 
			
		||||
#define	R_IA64_REL64MSB		0x6e	/* word64 MSB	BD + A */
 | 
			
		||||
#define	R_IA64_REL64LSB		0x6f	/* word64 LSB	BD + A */
 | 
			
		||||
#define	R_IA64_LTV32MSB		0x74	/* word32 MSB	S + A */
 | 
			
		||||
#define	R_IA64_LTV32LSB		0x75	/* word32 LSB	S + A */
 | 
			
		||||
#define	R_IA64_LTV64MSB		0x76	/* word64 MSB	S + A */
 | 
			
		||||
#define	R_IA64_LTV64LSB		0x77	/* word64 LSB	S + A */
 | 
			
		||||
#define	R_IA64_IPLTMSB		0x80	/* function descriptor MSB special */
 | 
			
		||||
#define	R_IA64_IPLTLSB		0x81	/* function descriptor LSB speciaal */
 | 
			
		||||
#define	R_IA64_SUB		0x85	/* immediate64	A - S */
 | 
			
		||||
#define	R_IA64_LTOFF22X		0x86	/* immediate22	special */
 | 
			
		||||
#define	R_IA64_LDXMOV		0x87	/* immediate22	special */
 | 
			
		||||
#define	R_IA64_TPREL14		0x91	/* imm14	@tprel(S + A) */
 | 
			
		||||
#define	R_IA64_TPREL22		0x92	/* imm22	@tprel(S + A) */
 | 
			
		||||
#define	R_IA64_TPREL64I		0x93	/* imm64	@tprel(S + A) */
 | 
			
		||||
#define	R_IA64_TPREL64MSB	0x96	/* word64 MSB	@tprel(S + A) */
 | 
			
		||||
#define	R_IA64_TPREL64LSB	0x97	/* word64 LSB	@tprel(S + A) */
 | 
			
		||||
#define	R_IA64_LTOFF_TPREL22	0x9a	/* imm22	@ltoff(@tprel(S+A)) */
 | 
			
		||||
#define	R_IA64_DTPMOD64MSB	0xa6	/* word64 MSB	@dtpmod(S + A) */
 | 
			
		||||
#define	R_IA64_DTPMOD64LSB	0xa7	/* word64 LSB	@dtpmod(S + A) */
 | 
			
		||||
#define	R_IA64_LTOFF_DTPMOD22	0xaa	/* imm22	@ltoff(@dtpmod(S+A)) */
 | 
			
		||||
#define	R_IA64_DTPREL14		0xb1	/* imm14	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL22		0xb2	/* imm22	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL64I	0xb3	/* imm64	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL32MSB	0xb4	/* word32 MSB	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL32LSB	0xb5	/* word32 LSB	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL64MSB	0xb6	/* word64 MSB	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_DTPREL64LSB	0xb7	/* word64 LSB	@dtprel(S + A) */
 | 
			
		||||
#define	R_IA64_LTOFF_DTPREL22	0xba	/* imm22	@ltoff(@dtprel(S+A)) */
 | 
			
		||||
 | 
			
		||||
/* p_type */
 | 
			
		||||
 | 
			
		||||
#define PT_IA_64_ARCHEXT 0x70000000	/* segment contains a section of type SHT_IA_64_EXT */
 | 
			
		||||
#define PT_IA_64_UNWIND  0x70000001	/* segment contains the stack unwind tables */
 | 
			
		||||
 | 
			
		||||
/* p_flags */
 | 
			
		||||
 | 
			
		||||
#define PF_IA_64_NORECOV 0x80000000	/* segment contains the stack unwind tables */
 | 
			
		||||
 | 
			
		||||
/* sh_type */
 | 
			
		||||
 | 
			
		||||
#define SHT_IA_64_EXT           0x70000000	/* section contains product specific extension bits */
 | 
			
		||||
#define SHT_IA_64_UNWIND        0x70000001	/* section contains unwind function table entries for stack unwinding */
 | 
			
		||||
#define SHT_IA_64_LOPSREG       0x78000000	/* reserved for implementation-specific section types */
 | 
			
		||||
#define SHT_IA_64_HIPSREG       0x7fffffff	/* Ditto */
 | 
			
		||||
#define SHT_IA_64_PRIORITY_INIT 0x79000000	/* section contains priority initialization record */
 | 
			
		||||
 | 
			
		||||
/* sh_flags */
 | 
			
		||||
 | 
			
		||||
#define SHF_IA_64_SHORT   0x10000000	/* section must be placed near gp. */
 | 
			
		||||
#define SHF_IA_64_NORECOV 0x20000000	/* section contains code that uses speculative instructions without
 | 
			
		||||
					 * recovery code
 | 
			
		||||
					 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ipf/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ipf/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <sys/endian.h>
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/Ipf/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/Ipf/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
#define _BYTE_ORDER _LITTLE_ENDIAN
 | 
			
		||||
							
								
								
									
										30
									
								
								StdLib/Include/Ipf/machine/float.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								StdLib/Include/Ipf/machine/float.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
			
		||||
/*	$NetBSD: float.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <sys/float_ieee754.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* #ifndef _IA64_FLOAT_H_ */
 | 
			
		||||
/* #define _IA64_FLOAT_H_ */
 | 
			
		||||
 | 
			
		||||
/* #define LDBL_MANT_DIG   64 */
 | 
			
		||||
/* #define LDBL_EPSILON    1.0842021724855044340E-19L */
 | 
			
		||||
/* #define LDBL_DIG        18 */
 | 
			
		||||
/* #define LDBL_MIN_EXP    (-16381) */
 | 
			
		||||
/* #define LDBL_MIN        3.3621031431120935063E-4932L */
 | 
			
		||||
/* #define LDBL_MIN_10_EXP (-4931) */
 | 
			
		||||
/* #define LDBL_MAX_EXP    16384 */
 | 
			
		||||
/* #define LDBL_MAX        1.1897314953572317650E+4932L */
 | 
			
		||||
/* #define LDBL_MAX_10_EXP 4932 */
 | 
			
		||||
 | 
			
		||||
/* #include <sys/float_ieee754.h> */
 | 
			
		||||
 | 
			
		||||
/* #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \ */
 | 
			
		||||
/*     !defined(_XOPEN_SOURCE) || \ */
 | 
			
		||||
/*     ((__STDC_VERSION__ - 0) >= 199901L) || \ */
 | 
			
		||||
/*     ((_POSIX_C_SOURCE - 0) >= 200112L) || \ */
 | 
			
		||||
/*     ((_XOPEN_SOURCE  - 0) >= 600) || \ */
 | 
			
		||||
/*     defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE) */
 | 
			
		||||
/* #define	DECIMAL_DIG	35 */
 | 
			
		||||
/* #endif /\* !defined(_ANSI_SOURCE) && ... *\/ */
 | 
			
		||||
 | 
			
		||||
/* #endif	/\* _IA64_FLOAT_H_ *\/ */
 | 
			
		||||
							
								
								
									
										427
									
								
								StdLib/Include/Ipf/machine/ia64_cpu.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										427
									
								
								StdLib/Include/Ipf/machine/ia64_cpu.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,427 @@
 | 
			
		||||
/*	$NetBSD: ia64_cpu.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2000 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	$FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_IA64_CPU_H_
 | 
			
		||||
#define _MACHINE_IA64_CPU_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Definition of PSR and IPSR bits.
 | 
			
		||||
 */
 | 
			
		||||
#define IA64_PSR_BE		0x0000000000000002
 | 
			
		||||
#define IA64_PSR_UP		0x0000000000000004
 | 
			
		||||
#define IA64_PSR_AC		0x0000000000000008
 | 
			
		||||
#define IA64_PSR_MFL		0x0000000000000010
 | 
			
		||||
#define IA64_PSR_MFH		0x0000000000000020
 | 
			
		||||
#define IA64_PSR_IC		0x0000000000002000
 | 
			
		||||
#define IA64_PSR_I		0x0000000000004000
 | 
			
		||||
#define IA64_PSR_PK		0x0000000000008000
 | 
			
		||||
#define IA64_PSR_DT		0x0000000000020000
 | 
			
		||||
#define IA64_PSR_DFL		0x0000000000040000
 | 
			
		||||
#define IA64_PSR_DFH		0x0000000000080000
 | 
			
		||||
#define IA64_PSR_SP		0x0000000000100000
 | 
			
		||||
#define IA64_PSR_PP		0x0000000000200000
 | 
			
		||||
#define IA64_PSR_DI		0x0000000000400000
 | 
			
		||||
#define IA64_PSR_SI		0x0000000000800000
 | 
			
		||||
#define IA64_PSR_DB		0x0000000001000000
 | 
			
		||||
#define IA64_PSR_LP		0x0000000002000000
 | 
			
		||||
#define IA64_PSR_TB		0x0000000004000000
 | 
			
		||||
#define IA64_PSR_RT		0x0000000008000000
 | 
			
		||||
#define IA64_PSR_CPL		0x0000000300000000
 | 
			
		||||
#define IA64_PSR_CPL_KERN	0x0000000000000000
 | 
			
		||||
#define IA64_PSR_CPL_1		0x0000000100000000
 | 
			
		||||
#define IA64_PSR_CPL_2		0x0000000200000000
 | 
			
		||||
#define IA64_PSR_CPL_USER	0x0000000300000000
 | 
			
		||||
#define IA64_PSR_IS		0x0000000400000000
 | 
			
		||||
#define IA64_PSR_MC		0x0000000800000000
 | 
			
		||||
#define IA64_PSR_IT		0x0000001000000000
 | 
			
		||||
#define IA64_PSR_ID		0x0000002000000000
 | 
			
		||||
#define IA64_PSR_DA		0x0000004000000000
 | 
			
		||||
#define IA64_PSR_DD		0x0000008000000000
 | 
			
		||||
#define IA64_PSR_SS		0x0000010000000000
 | 
			
		||||
#define IA64_PSR_RI		0x0000060000000000
 | 
			
		||||
#define IA64_PSR_RI_0		0x0000000000000000
 | 
			
		||||
#define IA64_PSR_RI_1		0x0000020000000000
 | 
			
		||||
#define IA64_PSR_RI_2		0x0000040000000000
 | 
			
		||||
#define IA64_PSR_ED		0x0000080000000000
 | 
			
		||||
#define IA64_PSR_BN		0x0000100000000000
 | 
			
		||||
#define IA64_PSR_IA		0x0000200000000000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Definition of ISR bits.
 | 
			
		||||
 */
 | 
			
		||||
#define IA64_ISR_CODE		0x000000000000ffff
 | 
			
		||||
#define IA64_ISR_VECTOR		0x0000000000ff0000
 | 
			
		||||
#define IA64_ISR_X		0x0000000100000000
 | 
			
		||||
#define IA64_ISR_W		0x0000000200000000
 | 
			
		||||
#define IA64_ISR_R		0x0000000400000000
 | 
			
		||||
#define IA64_ISR_NA		0x0000000800000000
 | 
			
		||||
#define IA64_ISR_SP		0x0000001000000000
 | 
			
		||||
#define IA64_ISR_RS		0x0000002000000000
 | 
			
		||||
#define IA64_ISR_IR		0x0000004000000000
 | 
			
		||||
#define IA64_ISR_NI		0x0000008000000000
 | 
			
		||||
#define IA64_ISR_SO		0x0000010000000000
 | 
			
		||||
#define IA64_ISR_EI		0x0000060000000000
 | 
			
		||||
#define IA64_ISR_EI_0		0x0000000000000000
 | 
			
		||||
#define IA64_ISR_EI_1		0x0000020000000000
 | 
			
		||||
#define IA64_ISR_EI_2		0x0000040000000000
 | 
			
		||||
#define IA64_ISR_ED		0x0000080000000000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Vector numbers for various ia64 interrupts.
 | 
			
		||||
 */
 | 
			
		||||
#define IA64_VEC_VHPT			0
 | 
			
		||||
#define IA64_VEC_ITLB			1
 | 
			
		||||
#define IA64_VEC_DTLB			2
 | 
			
		||||
#define IA64_VEC_ALT_ITLB		3
 | 
			
		||||
#define IA64_VEC_ALT_DTLB		4
 | 
			
		||||
#define IA64_VEC_NESTED_DTLB		5
 | 
			
		||||
#define IA64_VEC_IKEY_MISS		6
 | 
			
		||||
#define IA64_VEC_DKEY_MISS		7
 | 
			
		||||
#define IA64_VEC_DIRTY_BIT		8
 | 
			
		||||
#define IA64_VEC_INST_ACCESS		9
 | 
			
		||||
#define IA64_VEC_DATA_ACCESS		10
 | 
			
		||||
#define IA64_VEC_BREAK			11
 | 
			
		||||
#define IA64_VEC_EXT_INTR		12
 | 
			
		||||
#define IA64_VEC_PAGE_NOT_PRESENT	20
 | 
			
		||||
#define IA64_VEC_KEY_PERMISSION		21
 | 
			
		||||
#define IA64_VEC_INST_ACCESS_RIGHTS	22
 | 
			
		||||
#define IA64_VEC_DATA_ACCESS_RIGHTS	23
 | 
			
		||||
#define IA64_VEC_GENERAL_EXCEPTION	24
 | 
			
		||||
#define IA64_VEC_DISABLED_FP		25
 | 
			
		||||
#define IA64_VEC_NAT_CONSUMPTION	26
 | 
			
		||||
#define IA64_VEC_SPECULATION		27
 | 
			
		||||
#define IA64_VEC_DEBUG			29
 | 
			
		||||
#define IA64_VEC_UNALIGNED_REFERENCE	30
 | 
			
		||||
#define IA64_VEC_UNSUPP_DATA_REFERENCE	31
 | 
			
		||||
#define IA64_VEC_FLOATING_POINT_FAULT	32
 | 
			
		||||
#define IA64_VEC_FLOATING_POINT_TRAP	33
 | 
			
		||||
#define IA64_VEC_LOWER_PRIVILEGE_TRANSFER 34
 | 
			
		||||
#define IA64_VEC_TAKEN_BRANCH_TRAP	35
 | 
			
		||||
#define IA64_VEC_SINGLE_STEP_TRAP	36
 | 
			
		||||
#define IA64_VEC_IA32_EXCEPTION		45
 | 
			
		||||
#define IA64_VEC_IA32_INTERCEPT		46
 | 
			
		||||
#define IA64_VEC_IA32_INTERRUPT		47
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IA-32 exceptions.
 | 
			
		||||
 */
 | 
			
		||||
#define IA32_EXCEPTION_DIVIDE		0
 | 
			
		||||
#define IA32_EXCEPTION_DEBUG		1
 | 
			
		||||
#define IA32_EXCEPTION_BREAK		3
 | 
			
		||||
#define IA32_EXCEPTION_OVERFLOW		4
 | 
			
		||||
#define IA32_EXCEPTION_BOUND		5
 | 
			
		||||
#define IA32_EXCEPTION_DNA		7
 | 
			
		||||
#define IA32_EXCEPTION_NOT_PRESENT	11
 | 
			
		||||
#define IA32_EXCEPTION_STACK_FAULT	12
 | 
			
		||||
#define IA32_EXCEPTION_GPFAULT		13
 | 
			
		||||
#define IA32_EXCEPTION_FPERROR		16
 | 
			
		||||
#define IA32_EXCEPTION_ALIGNMENT_CHECK	17
 | 
			
		||||
#define IA32_EXCEPTION_STREAMING_SIMD	19
 | 
			
		||||
 | 
			
		||||
#define IA32_INTERCEPT_INSTRUCTION	0
 | 
			
		||||
#define IA32_INTERCEPT_GATE		1
 | 
			
		||||
#define IA32_INTERCEPT_SYSTEM_FLAG	2
 | 
			
		||||
#define IA32_INTERCEPT_LOCK		4
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Various special ia64 instructions.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Memory Fence.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_mf(void)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("mf");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_mf_a(void)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("mf.a");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Flush Cache.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_fc(u_int64_t va)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("fc %0" :: "r"(va));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * Flush Instruction Cache
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_fc_i(u_int64_t va)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("fc.i %0" :: "r"(va));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Sync instruction stream.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_sync_i(void)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("sync.i");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Calculate address in VHPT for va.
 | 
			
		||||
 */
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
ia64_thash(u_int64_t va)
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t result;
 | 
			
		||||
	__asm __volatile("thash %0=%1" : "=r" (result) : "r" (va));
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Calculate VHPT tag for va.
 | 
			
		||||
 */
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
ia64_ttag(u_int64_t va)
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t result;
 | 
			
		||||
	__asm __volatile("ttag %0=%1" : "=r" (result) : "r" (va));
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Convert virtual address to physical.
 | 
			
		||||
 */
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
ia64_tpa(u_int64_t va)
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t result;
 | 
			
		||||
	__asm __volatile("tpa %0=%1" : "=r" (result) : "r" (va));
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generate a ptc.e instruction.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_ptc_e(u_int64_t v)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("ptc.e %0;; srlz.d;;" :: "r"(v));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generate a ptc.g instruction.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_ptc_g(u_int64_t va, u_int64_t log2size)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("ptc.g %0,%1;; srlz.d;;" :: "r"(va), "r"(log2size));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generate a ptc.ga instruction.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_ptc_ga(u_int64_t va, u_int64_t log2size)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("ptc.ga %0,%1;; srlz.d;;" :: "r"(va), "r"(log2size));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generate a ptc.l instruction.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_ptc_l(u_int64_t va, u_int64_t log2size)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("ptc.l %0,%1;; srlz.d;;" :: "r"(va), "r"(log2size));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Read the value of psr.
 | 
			
		||||
 */
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
ia64_get_psr(void)
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t result;
 | 
			
		||||
	__asm __volatile("mov %0=psr;;" : "=r" (result));
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Define accessors for application registers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define IA64_AR(name)						\
 | 
			
		||||
								\
 | 
			
		||||
static __inline u_int64_t					\
 | 
			
		||||
ia64_get_##name(void)						\
 | 
			
		||||
{								\
 | 
			
		||||
	u_int64_t result;					\
 | 
			
		||||
	__asm __volatile("mov %0=ar." #name : "=r" (result));	\
 | 
			
		||||
	return result;						\
 | 
			
		||||
}								\
 | 
			
		||||
								\
 | 
			
		||||
static __inline void						\
 | 
			
		||||
ia64_set_##name(u_int64_t v)					\
 | 
			
		||||
{								\
 | 
			
		||||
	__asm __volatile("mov ar." #name "=%0;;" :: "r" (v));	\
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
IA64_AR(k0)
 | 
			
		||||
IA64_AR(k1)
 | 
			
		||||
IA64_AR(k2)
 | 
			
		||||
IA64_AR(k3)
 | 
			
		||||
IA64_AR(k4)
 | 
			
		||||
IA64_AR(k5)
 | 
			
		||||
IA64_AR(k6)
 | 
			
		||||
IA64_AR(k7)
 | 
			
		||||
 | 
			
		||||
IA64_AR(rsc)
 | 
			
		||||
IA64_AR(bsp)
 | 
			
		||||
IA64_AR(bspstore)
 | 
			
		||||
IA64_AR(rnat)
 | 
			
		||||
 | 
			
		||||
IA64_AR(fcr)
 | 
			
		||||
 | 
			
		||||
IA64_AR(eflag)
 | 
			
		||||
IA64_AR(csd)
 | 
			
		||||
IA64_AR(ssd)
 | 
			
		||||
IA64_AR(cflg)
 | 
			
		||||
IA64_AR(fsr)
 | 
			
		||||
IA64_AR(fir)
 | 
			
		||||
IA64_AR(fdr)
 | 
			
		||||
 | 
			
		||||
IA64_AR(ccv)
 | 
			
		||||
 | 
			
		||||
IA64_AR(unat)
 | 
			
		||||
 | 
			
		||||
IA64_AR(fpsr)
 | 
			
		||||
 | 
			
		||||
IA64_AR(itc)
 | 
			
		||||
 | 
			
		||||
IA64_AR(pfs)
 | 
			
		||||
IA64_AR(lc)
 | 
			
		||||
IA64_AR(ec)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Define accessors for control registers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define IA64_CR(name)						\
 | 
			
		||||
								\
 | 
			
		||||
static __inline u_int64_t					\
 | 
			
		||||
ia64_get_##name(void)						\
 | 
			
		||||
{								\
 | 
			
		||||
	u_int64_t result;					\
 | 
			
		||||
	__asm __volatile("mov %0=cr." #name : "=r" (result));	\
 | 
			
		||||
	return result;						\
 | 
			
		||||
}								\
 | 
			
		||||
								\
 | 
			
		||||
static __inline void						\
 | 
			
		||||
ia64_set_##name(u_int64_t v)					\
 | 
			
		||||
{								\
 | 
			
		||||
	__asm __volatile("mov cr." #name "=%0;;" :: "r" (v));	\
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
IA64_CR(dcr)
 | 
			
		||||
IA64_CR(itm)
 | 
			
		||||
IA64_CR(iva)
 | 
			
		||||
 | 
			
		||||
IA64_CR(pta)
 | 
			
		||||
 | 
			
		||||
IA64_CR(ipsr)
 | 
			
		||||
IA64_CR(isr)
 | 
			
		||||
 | 
			
		||||
IA64_CR(iip)
 | 
			
		||||
IA64_CR(ifa)
 | 
			
		||||
IA64_CR(itir)
 | 
			
		||||
IA64_CR(iipa)
 | 
			
		||||
IA64_CR(ifs)
 | 
			
		||||
IA64_CR(iim)
 | 
			
		||||
IA64_CR(iha)
 | 
			
		||||
 | 
			
		||||
IA64_CR(lid)
 | 
			
		||||
IA64_CR(ivr)
 | 
			
		||||
IA64_CR(tpr)
 | 
			
		||||
IA64_CR(eoi)
 | 
			
		||||
IA64_CR(irr0)
 | 
			
		||||
IA64_CR(irr1)
 | 
			
		||||
IA64_CR(irr2)
 | 
			
		||||
IA64_CR(irr3)
 | 
			
		||||
IA64_CR(itv)
 | 
			
		||||
IA64_CR(pmv)
 | 
			
		||||
IA64_CR(cmcv)
 | 
			
		||||
 | 
			
		||||
IA64_CR(lrr0)
 | 
			
		||||
IA64_CR(lrr1)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Write a region register.
 | 
			
		||||
 */
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_set_rr(u_int64_t rrbase, u_int64_t v)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("mov rr[%0]=%1;; srlz.d;;"
 | 
			
		||||
			 :: "r"(rrbase), "r"(v) : "memory");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Read a CPUID register.
 | 
			
		||||
 */
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
ia64_get_cpuid(int i)
 | 
			
		||||
{
 | 
			
		||||
	u_int64_t result;
 | 
			
		||||
	__asm __volatile("mov %0=cpuid[%1]"
 | 
			
		||||
			 : "=r" (result) : "r"(i));
 | 
			
		||||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_disable_highfp(void)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("ssm psr.dfh;; srlz.d");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
ia64_enable_highfp(void)
 | 
			
		||||
{
 | 
			
		||||
	__asm __volatile("rsm psr.dfh;; srlz.d");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* !_LOCORE */
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_IA64_CPU_H_ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								StdLib/Include/Ipf/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								StdLib/Include/Ipf/machine/ieee.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
 | 
			
		||||
#include  <sys/ieee754.h>
 | 
			
		||||
							
								
								
									
										48
									
								
								StdLib/Include/Ipf/machine/ieeefp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								StdLib/Include/Ipf/machine/ieeefp.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,48 @@
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/ieeefp.h,v 1.5.10.1.4.1 2010/06/14 02:09:06 kensmith Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_IEEEFP_H_
 | 
			
		||||
#define _MACHINE_IEEEFP_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/fpu.h>
 | 
			
		||||
 | 
			
		||||
typedef int fp_except_t;
 | 
			
		||||
#define	FP_X_INV	IA64_FPSR_TRAP_VD /* invalid operation exception */
 | 
			
		||||
#define	FP_X_DZ		IA64_FPSR_TRAP_ZD /* divide-by-zero exception */
 | 
			
		||||
#define	FP_X_OFL	IA64_FPSR_TRAP_OD /* overflow exception */
 | 
			
		||||
#define	FP_X_UFL	IA64_FPSR_TRAP_UD /* underflow exception */
 | 
			
		||||
#define	FP_X_IMP	IA64_FPSR_TRAP_ID /* imprecise(inexact) exception */
 | 
			
		||||
 | 
			
		||||
typedef enum {
 | 
			
		||||
	FP_RN = 0,		/* round to nearest */
 | 
			
		||||
	FP_RM,			/* round toward minus infinity */
 | 
			
		||||
	FP_RP,			/* round toward plus infinity */
 | 
			
		||||
	FP_RZ			/* round toward zero */
 | 
			
		||||
} fp_rnd_t;
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_IEEEFP_H_ */
 | 
			
		||||
							
								
								
									
										64
									
								
								StdLib/Include/Ipf/machine/int_const.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								StdLib/Include/Ipf/machine/int_const.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
			
		||||
/*	$NetBSD: int_const.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_INT_CONST_H_
 | 
			
		||||
#define _IA64_INT_CONST_H_
 | 
			
		||||
 | 
			
		||||
/* XXX: cherry: needs to be audited */
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.4 Macros for integer constants
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.4.1 Macros for minimum-width integer constants */
 | 
			
		||||
 | 
			
		||||
#define	INT8_C(c)	c
 | 
			
		||||
#define	INT16_C(c)	c
 | 
			
		||||
#define	INT32_C(c)	c
 | 
			
		||||
#define	INT64_C(c)	c ## L
 | 
			
		||||
 | 
			
		||||
#define	UINT8_C(c)	c ## U
 | 
			
		||||
#define	UINT16_C(c)	c ## U
 | 
			
		||||
#define	UINT32_C(c)	c ## U
 | 
			
		||||
#define	UINT64_C(c)	c ## UL
 | 
			
		||||
 | 
			
		||||
/* 7.18.4.2 Macros for greatest-width integer constants */
 | 
			
		||||
 | 
			
		||||
#define	INTMAX_C(c)	c ## L
 | 
			
		||||
#define	UINTMAX_C(c)	c ## UL
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_INT_CONST_H_ */
 | 
			
		||||
							
								
								
									
										219
									
								
								StdLib/Include/Ipf/machine/int_fmtio.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										219
									
								
								StdLib/Include/Ipf/machine/int_fmtio.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,219 @@
 | 
			
		||||
/*	$NetBSD: int_fmtio.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_INT_FMTIO_H_
 | 
			
		||||
#define _IA64_INT_FMTIO_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.8.1 Macros for format specifiers
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* fprintf macros for signed integers */
 | 
			
		||||
 | 
			
		||||
#define	PRId8		"d"	/* int8_t		*/
 | 
			
		||||
#define	PRId16		"d"	/* int16_t		*/
 | 
			
		||||
#define	PRId32		"d"	/* int32_t		*/
 | 
			
		||||
#define	PRId64		"ld"	/* int64_t		*/
 | 
			
		||||
#define	PRIdLEAST8	"d"	/* int_least8_t		*/
 | 
			
		||||
#define	PRIdLEAST16	"d"	/* int_least16_t	*/
 | 
			
		||||
#define	PRIdLEAST32	"d"	/* int_least32_t	*/
 | 
			
		||||
#define	PRIdLEAST64	"ld"	/* int_least64_t	*/
 | 
			
		||||
#define	PRIdFAST8	"d"	/* int_fast8_t		*/
 | 
			
		||||
#define	PRIdFAST16	"d"	/* int_fast16_t		*/
 | 
			
		||||
#define	PRIdFAST32	"d"	/* int_fast32_t		*/
 | 
			
		||||
#define	PRIdFAST64	"ld"	/* int_fast64_t		*/
 | 
			
		||||
#define	PRIdMAX		"ld"	/* intmax_t		*/
 | 
			
		||||
#define	PRIdPTR		"ld"	/* intptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	PRIi8		"i"	/* int8_t		*/
 | 
			
		||||
#define	PRIi16		"i"	/* int16_t		*/
 | 
			
		||||
#define	PRIi32		"i"	/* int32_t		*/
 | 
			
		||||
#define	PRIi64		"li"	/* int64_t		*/
 | 
			
		||||
#define	PRIiLEAST8	"i"	/* int_least8_t		*/
 | 
			
		||||
#define	PRIiLEAST16	"i"	/* int_least16_t	*/
 | 
			
		||||
#define	PRIiLEAST32	"i"	/* int_least32_t	*/
 | 
			
		||||
#define	PRIiLEAST64	"li"	/* int_least64_t	*/
 | 
			
		||||
#define	PRIiFAST8	"i"	/* int_fast8_t		*/
 | 
			
		||||
#define	PRIiFAST16	"i"	/* int_fast16_t		*/
 | 
			
		||||
#define	PRIiFAST32	"i"	/* int_fast32_t		*/
 | 
			
		||||
#define	PRIiFAST64	"li"	/* int_fast64_t		*/
 | 
			
		||||
#define	PRIiMAX		"li"	/* intmax_t		*/
 | 
			
		||||
#define	PRIiPTR		"li"	/* intptr_t		*/
 | 
			
		||||
 | 
			
		||||
/* fprintf macros for unsigned integers */
 | 
			
		||||
 | 
			
		||||
#define	PRIo8		"o"	/* uint8_t		*/
 | 
			
		||||
#define	PRIo16		"o"	/* uint16_t		*/
 | 
			
		||||
#define	PRIo32		"o"	/* uint32_t		*/
 | 
			
		||||
#define	PRIo64		"lo"	/* uint64_t		*/
 | 
			
		||||
#define	PRIoLEAST8	"o"	/* uint_least8_t	*/
 | 
			
		||||
#define	PRIoLEAST16	"o"	/* uint_least16_t	*/
 | 
			
		||||
#define	PRIoLEAST32	"o"	/* uint_least32_t	*/
 | 
			
		||||
#define	PRIoLEAST64	"lo"	/* uint_least64_t	*/
 | 
			
		||||
#define	PRIoFAST8	"o"	/* uint_fast8_t		*/
 | 
			
		||||
#define	PRIoFAST16	"o"	/* uint_fast16_t	*/
 | 
			
		||||
#define	PRIoFAST32	"o"	/* uint_fast32_t	*/
 | 
			
		||||
#define	PRIoFAST64	"lo"	/* uint_fast64_t	*/
 | 
			
		||||
#define	PRIoMAX		"lo"	/* uintmax_t		*/
 | 
			
		||||
#define	PRIoPTR		"lo"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	PRIu8		"u"	/* uint8_t		*/
 | 
			
		||||
#define	PRIu16		"u"	/* uint16_t		*/
 | 
			
		||||
#define	PRIu32		"u"	/* uint32_t		*/
 | 
			
		||||
#define	PRIu64		"lu"	/* uint64_t		*/
 | 
			
		||||
#define	PRIuLEAST8	"u"	/* uint_least8_t	*/
 | 
			
		||||
#define	PRIuLEAST16	"u"	/* uint_least16_t	*/
 | 
			
		||||
#define	PRIuLEAST32	"u"	/* uint_least32_t	*/
 | 
			
		||||
#define	PRIuLEAST64	"lu"	/* uint_least64_t	*/
 | 
			
		||||
#define	PRIuFAST8	"u"	/* uint_fast8_t		*/
 | 
			
		||||
#define	PRIuFAST16	"u"	/* uint_fast16_t	*/
 | 
			
		||||
#define	PRIuFAST32	"u"	/* uint_fast32_t	*/
 | 
			
		||||
#define	PRIuFAST64	"lu"	/* uint_fast64_t	*/
 | 
			
		||||
#define	PRIuMAX		"lu"	/* uintmax_t		*/
 | 
			
		||||
#define	PRIuPTR		"lu"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	PRIx8		"x"	/* uint8_t		*/
 | 
			
		||||
#define	PRIx16		"x"	/* uint16_t		*/
 | 
			
		||||
#define	PRIx32		"x"	/* uint32_t		*/
 | 
			
		||||
#define	PRIx64		"lx"	/* uint64_t		*/
 | 
			
		||||
#define	PRIxLEAST8	"x"	/* uint_least8_t	*/
 | 
			
		||||
#define	PRIxLEAST16	"x"	/* uint_least16_t	*/
 | 
			
		||||
#define	PRIxLEAST32	"x"	/* uint_least32_t	*/
 | 
			
		||||
#define	PRIxLEAST64	"lx"	/* uint_least64_t	*/
 | 
			
		||||
#define	PRIxFAST8	"x"	/* uint_fast8_t		*/
 | 
			
		||||
#define	PRIxFAST16	"x"	/* uint_fast16_t	*/
 | 
			
		||||
#define	PRIxFAST32	"x"	/* uint_fast32_t	*/
 | 
			
		||||
#define	PRIxFAST64	"lx"	/* uint_fast64_t	*/
 | 
			
		||||
#define	PRIxMAX		"lx"	/* uintmax_t		*/
 | 
			
		||||
#define	PRIxPTR		"lx"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	PRIX8		"X"	/* uint8_t		*/
 | 
			
		||||
#define	PRIX16		"X"	/* uint16_t		*/
 | 
			
		||||
#define	PRIX32		"X"	/* uint32_t		*/
 | 
			
		||||
#define	PRIX64		"lX"	/* uint64_t		*/
 | 
			
		||||
#define	PRIXLEAST8	"X"	/* uint_least8_t	*/
 | 
			
		||||
#define	PRIXLEAST16	"X"	/* uint_least16_t	*/
 | 
			
		||||
#define	PRIXLEAST32	"X"	/* uint_least32_t	*/
 | 
			
		||||
#define	PRIXLEAST64	"lX"	/* uint_least64_t	*/
 | 
			
		||||
#define	PRIXFAST8	"X"	/* uint_fast8_t		*/
 | 
			
		||||
#define	PRIXFAST16	"X"	/* uint_fast16_t	*/
 | 
			
		||||
#define	PRIXFAST32	"X"	/* uint_fast32_t	*/
 | 
			
		||||
#define	PRIXFAST64	"lX"	/* uint_fast64_t	*/
 | 
			
		||||
#define	PRIXMAX		"lX"	/* uintmax_t		*/
 | 
			
		||||
#define	PRIXPTR		"lX"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
/* fscanf macros for signed integers */
 | 
			
		||||
 | 
			
		||||
#define	SCNd8		"hhd"	/* int8_t		*/
 | 
			
		||||
#define	SCNd16		"hd"	/* int16_t		*/
 | 
			
		||||
#define	SCNd32		"d"	/* int32_t		*/
 | 
			
		||||
#define	SCNd64		"ld"	/* int64_t		*/
 | 
			
		||||
#define	SCNdLEAST8	"hhd"	/* int_least8_t		*/
 | 
			
		||||
#define	SCNdLEAST16	"hd"	/* int_least16_t	*/
 | 
			
		||||
#define	SCNdLEAST32	"d"	/* int_least32_t	*/
 | 
			
		||||
#define	SCNdLEAST64	"ld"	/* int_least64_t	*/
 | 
			
		||||
#define	SCNdFAST8	"d"	/* int_fast8_t		*/
 | 
			
		||||
#define	SCNdFAST16	"d"	/* int_fast16_t		*/
 | 
			
		||||
#define	SCNdFAST32	"d"	/* int_fast32_t		*/
 | 
			
		||||
#define	SCNdFAST64	"ld"	/* int_fast64_t		*/
 | 
			
		||||
#define	SCNdMAX		"ld"	/* intmax_t		*/
 | 
			
		||||
#define	SCNdPTR		"ld"	/* intptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	SCNi8		"hhi"	/* int8_t		*/
 | 
			
		||||
#define	SCNi16		"hi"	/* int16_t		*/
 | 
			
		||||
#define	SCNi32		"i"	/* int32_t		*/
 | 
			
		||||
#define	SCNi64		"li"	/* int64_t		*/
 | 
			
		||||
#define	SCNiLEAST8	"hhi"	/* int_least8_t		*/
 | 
			
		||||
#define	SCNiLEAST16	"hi"	/* int_least16_t	*/
 | 
			
		||||
#define	SCNiLEAST32	"i"	/* int_least32_t	*/
 | 
			
		||||
#define	SCNiLEAST64	"li"	/* int_least64_t	*/
 | 
			
		||||
#define	SCNiFAST8	"i"	/* int_fast8_t		*/
 | 
			
		||||
#define	SCNiFAST16	"i"	/* int_fast16_t		*/
 | 
			
		||||
#define	SCNiFAST32	"i"	/* int_fast32_t		*/
 | 
			
		||||
#define	SCNiFAST64	"li"	/* int_fast64_t		*/
 | 
			
		||||
#define	SCNiMAX		"li"	/* intmax_t		*/
 | 
			
		||||
#define	SCNiPTR		"li"	/* intptr_t		*/
 | 
			
		||||
 | 
			
		||||
/* fscanf macros for unsigned integers */
 | 
			
		||||
 | 
			
		||||
#define	SCNo8		"hho"	/* uint8_t		*/
 | 
			
		||||
#define	SCNo16		"ho"	/* uint16_t		*/
 | 
			
		||||
#define	SCNo32		"o"	/* uint32_t		*/
 | 
			
		||||
#define	SCNo64		"lo"	/* uint64_t		*/
 | 
			
		||||
#define	SCNoLEAST8	"hho"	/* uint_least8_t	*/
 | 
			
		||||
#define	SCNoLEAST16	"ho"	/* uint_least16_t	*/
 | 
			
		||||
#define	SCNoLEAST32	"o"	/* uint_least32_t	*/
 | 
			
		||||
#define	SCNoLEAST64	"lo"	/* uint_least64_t	*/
 | 
			
		||||
#define	SCNoFAST8	"o"	/* uint_fast8_t		*/
 | 
			
		||||
#define	SCNoFAST16	"o"	/* uint_fast16_t	*/
 | 
			
		||||
#define	SCNoFAST32	"o"	/* uint_fast32_t	*/
 | 
			
		||||
#define	SCNoFAST64	"lo"	/* uint_fast64_t	*/
 | 
			
		||||
#define	SCNoMAX		"lo"	/* uintmax_t		*/
 | 
			
		||||
#define	SCNoPTR		"lo"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	SCNu8		"hhu"	/* uint8_t		*/
 | 
			
		||||
#define	SCNu16		"hu"	/* uint16_t		*/
 | 
			
		||||
#define	SCNu32		"u"	/* uint32_t		*/
 | 
			
		||||
#define	SCNu64		"lu"	/* uint64_t		*/
 | 
			
		||||
#define	SCNuLEAST8	"hhu"	/* uint_least8_t	*/
 | 
			
		||||
#define	SCNuLEAST16	"hu"	/* uint_least16_t	*/
 | 
			
		||||
#define	SCNuLEAST32	"u"	/* uint_least32_t	*/
 | 
			
		||||
#define	SCNuLEAST64	"lu"	/* uint_least64_t	*/
 | 
			
		||||
#define	SCNuFAST8	"u"	/* uint_fast8_t		*/
 | 
			
		||||
#define	SCNuFAST16	"u"	/* uint_fast16_t	*/
 | 
			
		||||
#define	SCNuFAST32	"u"	/* uint_fast32_t	*/
 | 
			
		||||
#define	SCNuFAST64	"lu"	/* uint_fast64_t	*/
 | 
			
		||||
#define	SCNuMAX		"lu"	/* uintmax_t		*/
 | 
			
		||||
#define	SCNuPTR		"lu"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#define	SCNx8		"hhx"	/* uint8_t		*/
 | 
			
		||||
#define	SCNx16		"hx"	/* uint16_t		*/
 | 
			
		||||
#define	SCNx32		"x"	/* uint32_t		*/
 | 
			
		||||
#define	SCNx64		"lx"	/* uint64_t		*/
 | 
			
		||||
#define	SCNxLEAST8	"hhx"	/* uint_least8_t	*/
 | 
			
		||||
#define	SCNxLEAST16	"hx"	/* uint_least16_t	*/
 | 
			
		||||
#define	SCNxLEAST32	"x"	/* uint_least32_t	*/
 | 
			
		||||
#define	SCNxLEAST64	"lx"	/* uint_least64_t	*/
 | 
			
		||||
#define	SCNxFAST8	"x"	/* uint_fast8_t		*/
 | 
			
		||||
#define	SCNxFAST16	"x"	/* uint_fast16_t	*/
 | 
			
		||||
#define	SCNxFAST32	"x"	/* uint_fast32_t	*/
 | 
			
		||||
#define	SCNxFAST64	"lx"	/* uint_fast64_t	*/
 | 
			
		||||
#define	SCNxMAX		"lx"	/* uintmax_t		*/
 | 
			
		||||
#define	SCNxPTR		"lx"	/* uintptr_t		*/
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_INT_FMTIO_H_ */
 | 
			
		||||
							
								
								
									
										134
									
								
								StdLib/Include/Ipf/machine/int_limits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								StdLib/Include/Ipf/machine/int_limits.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,134 @@
 | 
			
		||||
/*	$NetBSD: int_limits.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_INT_LIMITS_H_
 | 
			
		||||
#define _IA64_INT_LIMITS_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.2 Limits of specified-width integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.1 Limits of exact-width integer types */
 | 
			
		||||
 | 
			
		||||
/* minimum values of exact-width signed integer types */
 | 
			
		||||
#define	INT8_MIN	(-0x7f-1)			/* int8_t	  */
 | 
			
		||||
#define	INT16_MIN	(-0x7fff-1)			/* int16_t	  */
 | 
			
		||||
#define	INT32_MIN	(-0x7fffffff-1)			/* int32_t	  */
 | 
			
		||||
#define	INT64_MIN	(-0x7fffffffffffffffL-1)	/* int64_t	  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of exact-width signed integer types */
 | 
			
		||||
#define	INT8_MAX	0x7f				/* int8_t	  */
 | 
			
		||||
#define	INT16_MAX	0x7fff				/* int16_t	  */
 | 
			
		||||
#define	INT32_MAX	0x7fffffff			/* int32_t	  */
 | 
			
		||||
#define	INT64_MAX	0x7fffffffffffffffL		/* int64_t	  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of exact-width unsigned integer types */
 | 
			
		||||
#define	UINT8_MAX	0xffU				/* uint8_t	  */
 | 
			
		||||
#define	UINT16_MAX	0xffffU				/* uint16_t	  */
 | 
			
		||||
#define	UINT32_MAX	0xffffffffU			/* uint32_t	  */
 | 
			
		||||
#define	UINT64_MAX	0xffffffffffffffffUL		/* uint64_t	  */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.2 Limits of minimum-width integer types */
 | 
			
		||||
 | 
			
		||||
/* minimum values of minimum-width signed integer types */
 | 
			
		||||
#define	INT_LEAST8_MIN	(-0x7f-1)			/* int_least8_t	  */
 | 
			
		||||
#define	INT_LEAST16_MIN	(-0x7fff-1)			/* int_least16_t  */
 | 
			
		||||
#define	INT_LEAST32_MIN	(-0x7fffffff-1)			/* int_least32_t  */
 | 
			
		||||
#define	INT_LEAST64_MIN	(-0x7fffffffffffffffL-1)	/* int_least64_t  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of minimum-width signed integer types */
 | 
			
		||||
#define	INT_LEAST8_MAX	0x7f				/* int_least8_t	  */
 | 
			
		||||
#define	INT_LEAST16_MAX	0x7fff				/* int_least16_t  */
 | 
			
		||||
#define	INT_LEAST32_MAX	0x7fffffff			/* int_least32_t  */
 | 
			
		||||
#define	INT_LEAST64_MAX	0x7fffffffffffffffL		/* int_least64_t  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of minimum-width unsigned integer types */
 | 
			
		||||
#define	UINT_LEAST8_MAX	 0xffU				/* uint_least8_t  */
 | 
			
		||||
#define	UINT_LEAST16_MAX 0xffffU			/* uint_least16_t */
 | 
			
		||||
#define	UINT_LEAST32_MAX 0xffffffffU			/* uint_least32_t */
 | 
			
		||||
#define	UINT_LEAST64_MAX 0xffffffffffffffffUL		/* uint_least64_t */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.3 Limits of fastest minimum-width integer types */
 | 
			
		||||
 
 | 
			
		||||
/* minimum values of fastest minimum-width signed integer types */
 | 
			
		||||
#define	INT_FAST8_MIN	(-0x7fffffff-1)			/* int_fast8_t	  */
 | 
			
		||||
#define	INT_FAST16_MIN	(-0x7fffffff-1)			/* int_fast16_t	  */
 | 
			
		||||
#define	INT_FAST32_MIN	(-0x7fffffff-1)			/* int_fast32_t	  */
 | 
			
		||||
#define	INT_FAST64_MIN	(-0x7fffffffffffffffLL-1)	/* int_fast64_t	  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of fastest minimum-width signed integer types */
 | 
			
		||||
#define	INT_FAST8_MAX	0x7fffffff			/* int_fast8_t	  */
 | 
			
		||||
#define	INT_FAST16_MAX	0x7fffffff			/* int_fast16_t	  */
 | 
			
		||||
#define	INT_FAST32_MAX	0x7fffffff			/* int_fast32_t	  */
 | 
			
		||||
#define	INT_FAST64_MAX	0x7fffffffffffffffLL		/* int_fast64_t	  */
 | 
			
		||||
 | 
			
		||||
/* maximum values of fastest minimum-width unsigned integer types */
 | 
			
		||||
#define	UINT_FAST8_MAX	0xffffffffU			/* uint_fast8_t	  */
 | 
			
		||||
#define	UINT_FAST16_MAX	0xffffffffU			/* uint_fast16_t  */
 | 
			
		||||
#define	UINT_FAST32_MAX	0xffffffffU			/* uint_fast32_t  */
 | 
			
		||||
#define	UINT_FAST64_MAX	0xffffffffffffffffULL		/* uint_fast64_t  */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.4 Limits of integer types capable of holding object pointers */
 | 
			
		||||
 | 
			
		||||
#define	INTPTR_MIN	(-0x7fffffffffffffffL-1)	/* intptr_t	  */
 | 
			
		||||
#define	INTPTR_MAX	0x7fffffffffffffffL		/* intptr_t	  */
 | 
			
		||||
#define	UINTPTR_MAX	0xffffffffffffffffUL		/* uintptr_t	  */
 | 
			
		||||
 | 
			
		||||
/* 7.18.2.5 Limits of greatest-width integer types */
 | 
			
		||||
 | 
			
		||||
#define	INTMAX_MIN	(-0x7fffffffffffffffL-1)	/* intmax_t	  */
 | 
			
		||||
#define	INTMAX_MAX	0x7fffffffffffffffL		/* intmax_t	  */
 | 
			
		||||
#define	UINTMAX_MAX	0xffffffffffffffffUL		/* uintmax_t	  */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.3 Limits of other integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* limits of ptrdiff_t */
 | 
			
		||||
#define	PTRDIFF_MIN	(-0x7fffffffffffffffL-1)	/* ptrdiff_t	  */
 | 
			
		||||
#define	PTRDIFF_MAX	0x7fffffffffffffffL		/* ptrdiff_t	  */
 | 
			
		||||
 | 
			
		||||
/* limits of sig_atomic_t */
 | 
			
		||||
#define	SIG_ATOMIC_MIN	(-0x7fffffffffffffffL-1)	/* sig_atomic_t	  */
 | 
			
		||||
#define	SIG_ATOMIC_MAX	0x7fffffffffffffffL		/* sig_atomic_t	  */
 | 
			
		||||
 | 
			
		||||
/* limit of size_t */
 | 
			
		||||
#define	SIZE_MAX	0xffffffffffffffffUL		/* size_t	  */
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_INT_LIMITS_H_ */
 | 
			
		||||
							
								
								
									
										83
									
								
								StdLib/Include/Ipf/machine/int_mwgwtypes.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										83
									
								
								StdLib/Include/Ipf/machine/int_mwgwtypes.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,83 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    Minimum and Greatest Width Integer types.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials are licensed and made available under
 | 
			
		||||
    the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
    The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
    Portions Copyright (c) 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
    All rights reserved.
 | 
			
		||||
 | 
			
		||||
    This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
    by Klaus Klein.
 | 
			
		||||
 | 
			
		||||
    Redistribution and use in source and binary forms, with or without
 | 
			
		||||
    modification, are permitted provided that the following conditions
 | 
			
		||||
    are met:
 | 
			
		||||
      1.  Redistributions of source code must retain the above copyright
 | 
			
		||||
          notice, this list of conditions and the following disclaimer.
 | 
			
		||||
      2.  Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
          notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
          documentation and/or other materials provided with the distribution.
 | 
			
		||||
      3.  All advertising materials mentioning features or use of this software
 | 
			
		||||
          must display the following acknowledgement:
 | 
			
		||||
            This product includes software developed by the NetBSD
 | 
			
		||||
            Foundation, Inc. and its contributors.
 | 
			
		||||
      4.  Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
          contributors may be used to endorse or promote products derived
 | 
			
		||||
          from this software without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
    THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
    PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
    POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
  NetBSD: int_mwgwtypes.h,v 1.1 2006/04/07 14:21:18 cherry Exp
 | 
			
		||||
**/
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_INT_MWGWTYPES_H_
 | 
			
		||||
#define _IA64_INT_MWGWTYPES_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.1 Integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.2 Minimum-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef CHAR8     int_least8_t;
 | 
			
		||||
typedef UINT8     uint_least8_t;
 | 
			
		||||
typedef INT16     int_least16_t;
 | 
			
		||||
typedef UINT16    uint_least16_t;
 | 
			
		||||
typedef INT32     int_least32_t;
 | 
			
		||||
typedef UINT32    uint_least32_t;
 | 
			
		||||
typedef INT64     int_least64_t;
 | 
			
		||||
typedef UINT64    uint_least64_t;
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.3 Fastest minimum-width integer types */
 | 
			
		||||
typedef INT32     int_fast8_t;
 | 
			
		||||
typedef UINT32    uint_fast8_t;
 | 
			
		||||
typedef INT32     int_fast16_t;
 | 
			
		||||
typedef UINT32    uint_fast16_t;
 | 
			
		||||
typedef INT32     int_fast32_t;
 | 
			
		||||
typedef UINT32    uint_fast32_t;
 | 
			
		||||
typedef INT64     int_fast64_t;
 | 
			
		||||
typedef UINT64    uint_fast64_t;
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.5 Greatest-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef INT64     intmax_t;
 | 
			
		||||
typedef UINT64    uintmax_t;
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_INT_MWGWTYPES_H_ */
 | 
			
		||||
							
								
								
									
										74
									
								
								StdLib/Include/Ipf/machine/int_types.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								StdLib/Include/Ipf/machine/int_types.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,74 @@
 | 
			
		||||
/*	$NetBSD: int_types.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	from: @(#)types.h	7.5 (Berkeley) 3/9/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef	_IA64_INT_TYPES_H_
 | 
			
		||||
#define	_IA64_INT_TYPES_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 7.18.1 Integer types
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.1 Exact-width integer types */
 | 
			
		||||
 | 
			
		||||
typedef	__signed char		 __int8_t;
 | 
			
		||||
typedef	unsigned char		__uint8_t;
 | 
			
		||||
typedef	short int		__int16_t;
 | 
			
		||||
typedef	unsigned short int     __uint16_t;
 | 
			
		||||
typedef	int			__int32_t;
 | 
			
		||||
typedef	unsigned int	       __uint32_t;
 | 
			
		||||
#ifdef __COMPILER_INT64__
 | 
			
		||||
typedef	__COMPILER_INT64__	__int64_t;
 | 
			
		||||
typedef	__COMPILER_UINT64__    __uint64_t;
 | 
			
		||||
#elif defined(_LP64)
 | 
			
		||||
typedef long int		__int64_t;
 | 
			
		||||
typedef unsigned long int      __uint64_t;
 | 
			
		||||
#else
 | 
			
		||||
/* LONGLONG */
 | 
			
		||||
typedef	long long int		__int64_t;
 | 
			
		||||
/* LONGLONG */
 | 
			
		||||
typedef	unsigned long long int __uint64_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	__BIT_TYPES_DEFINED__
 | 
			
		||||
 | 
			
		||||
/* 7.18.1.4 Integer types capable of holding object pointers */
 | 
			
		||||
 | 
			
		||||
#ifdef _LP64
 | 
			
		||||
typedef long int	       __intptr_t;
 | 
			
		||||
typedef unsigned long int     __uintptr_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef	int		       __intptr_t;
 | 
			
		||||
typedef	unsigned int	      __uintptr_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif	/* !_IA64_INT_TYPES_H_ */
 | 
			
		||||
							
								
								
									
										60
									
								
								StdLib/Include/Ipf/machine/intr.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										60
									
								
								StdLib/Include/Ipf/machine/intr.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,60 @@
 | 
			
		||||
/*	$NetBSD: intr.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/* XXX: cherry: To Be fixed when we switch on interrupts. */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_INTR_H_
 | 
			
		||||
#define _IA64_INTR_H_
 | 
			
		||||
 | 
			
		||||
#define	IPL_NONE	0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_BIO		0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_NET		0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_TTY		0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_CLOCK	0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_HIGH	0	/* XXX: Placeholder */
 | 
			
		||||
#define	IPL_SERIAL	0	/* XXX: Placeholder */
 | 
			
		||||
#define IPL_SCHED       0       /* XXX: Placeholder */
 | 
			
		||||
#define	IPL_VM    	0	/* XXX: Placeholder */
 | 
			
		||||
 | 
			
		||||
#define IPL_SOFTCLOCK   0	/* XXX: Placeholder */
 | 
			
		||||
#define IPL_SOFTNET     0	/* XXX: Placeholder */
 | 
			
		||||
#define IPL_SOFTSERIAL  0	/* XXX: Placeholder */
 | 
			
		||||
 | 
			
		||||
static __inline int splraise(int dummy) { return 0; }
 | 
			
		||||
static __inline void spllower(int dummy) { }
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Hardware interrupt masks
 | 
			
		||||
 */
 | 
			
		||||
#define	splbio()	splraise(IPL_BIO)
 | 
			
		||||
#define	splnet()	splraise(IPL_NET)
 | 
			
		||||
#define	spltty()	splraise(IPL_TTY)
 | 
			
		||||
#define	splaudio()	splraise(IPL_AUDIO)
 | 
			
		||||
#define	splclock()	splraise(IPL_CLOCK)
 | 
			
		||||
#define	splstatclock()	splclock()
 | 
			
		||||
#define	splserial()	splraise(IPL_SERIAL)
 | 
			
		||||
#define splipi()	splraise(IPL_IPI)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Miscellaneous
 | 
			
		||||
 */
 | 
			
		||||
#define	splvm()		splraise(IPL_VM)
 | 
			
		||||
#define	splhigh()	splraise(IPL_HIGH)
 | 
			
		||||
#define	spl0()		spllower(IPL_NONE)
 | 
			
		||||
#define	splsched()	splraise(IPL_SCHED)
 | 
			
		||||
#define spllock() 	splhigh()
 | 
			
		||||
#define	splx(x)		spllower(x)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Software interrupt masks
 | 
			
		||||
 *
 | 
			
		||||
 * NOTE: spllowersoftclock() is used by hardclock() to lower the priority from
 | 
			
		||||
 * clock to softclock before it calls softclock().
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define spllowersoftclock() spllower(IPL_SOFTCLOCK)
 | 
			
		||||
#define	splsoftclock() splraise(IPL_SOFTCLOCK)
 | 
			
		||||
#define	splsoftnet()	splraise(IPL_SOFTNET)
 | 
			
		||||
#define	splsoftserial()	splraise(IPL_SOFTSERIAL)
 | 
			
		||||
 | 
			
		||||
#endif /* ! _IA64_INTR_H_ */
 | 
			
		||||
							
								
								
									
										43
									
								
								StdLib/Include/Ipf/machine/intrcnt.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								StdLib/Include/Ipf/machine/intrcnt.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,43 @@
 | 
			
		||||
/* $NetBSD: intrcnt.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Author: Chris G. Demetriou
 | 
			
		||||
 *
 | 
			
		||||
 * Permission to use, copy, modify and distribute this software and
 | 
			
		||||
 * its documentation is hereby granted, provided that both the copyright
 | 
			
		||||
 * notice and this permission notice appear in all copies of the
 | 
			
		||||
 * software, derivative works or modified versions, and any portions
 | 
			
		||||
 * thereof, and that both notices appear in supporting documentation.
 | 
			
		||||
 *
 | 
			
		||||
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 | 
			
		||||
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
 | 
			
		||||
 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 | 
			
		||||
 *
 | 
			
		||||
 * Carnegie Mellon requests users of this software to return to
 | 
			
		||||
 *
 | 
			
		||||
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 | 
			
		||||
 *  School of Computer Science
 | 
			
		||||
 *  Carnegie Mellon University
 | 
			
		||||
 *  Pittsburgh PA 15213-3890
 | 
			
		||||
 *
 | 
			
		||||
 * any improvements or extensions that they make and grant Carnegie the
 | 
			
		||||
 * rights to redistribute these changes.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	INTRCNT_CLOCK		0
 | 
			
		||||
#define	INTRCNT_ISA_IRQ		(INTRCNT_CLOCK + 1)
 | 
			
		||||
#define	INTRCNT_ISA_IRQ_LEN	16
 | 
			
		||||
#define	INTRCNT_OTHER_BASE	(INTRCNT_ISA_IRQ + INTRCNT_ISA_IRQ_LEN)
 | 
			
		||||
#define	INTRCNT_OTHER_LEN	240
 | 
			
		||||
#define	INTRCNT_COUNT		(INTRCNT_OTHER_BASE + INTRCNT_OTHER_LEN)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Maximum name length in intrnames table (including terminating '\0'.
 | 
			
		||||
 * Since vmstat(8) assumes a maximum length of 13 (including '\0'), we're
 | 
			
		||||
 * pretty much limited to that (unless we don't care about the alignment
 | 
			
		||||
 * of the columns :-)
 | 
			
		||||
 */
 | 
			
		||||
#define INTRNAME_LEN		13
 | 
			
		||||
							
								
								
									
										89
									
								
								StdLib/Include/Ipf/machine/limits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								StdLib/Include/Ipf/machine/limits.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,89 @@
 | 
			
		||||
/*  $NetBSD: limits.h,v 1.2 2006/05/14 21:55:38 elad Exp $  */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1988 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *  @(#)limits.h  7.2 (Berkeley) 6/28/90
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_LIMITS_H_
 | 
			
		||||
#define _MACHINE_LIMITS_H_
 | 
			
		||||
 | 
			
		||||
#define __CHAR_BIT  8   /* number of bits in a char */
 | 
			
		||||
//#define MB_LEN_MAX  32    /* no multibyte characters */
 | 
			
		||||
 | 
			
		||||
#define __SCHAR_MIN (-128) /* max value for a signed char */
 | 
			
		||||
#define __SCHAR_MAX 127    /* min value for a signed char */
 | 
			
		||||
 | 
			
		||||
#define __UCHAR_MAX 255   /* max value for an unsigned char */
 | 
			
		||||
//#define CHAR_MAX  0x7f    /* max value for a char */
 | 
			
		||||
//#define CHAR_MIN  (-0x7f-1) /* min value for a char */
 | 
			
		||||
 | 
			
		||||
#define __USHRT_MAX 0xffffU   /* max value for an unsigned short */
 | 
			
		||||
#define __SHRT_MAX  0x7fff    /* max value for a short */
 | 
			
		||||
#define __SHRT_MIN  (-0x7fff-1) /* min value for a short */
 | 
			
		||||
 | 
			
		||||
#define __UINT_MAX  0xffffffffU /* max value for an unsigned int */
 | 
			
		||||
#define __INT_MAX   0x7fffffff  /* max value for an int */
 | 
			
		||||
#define __INT_MIN         (-0x7fffffff-1) /* min value for an int */
 | 
			
		||||
 | 
			
		||||
//#define __ULONG_MAX 0xffffffffffffffffUL  /* max value for an unsigned long */
 | 
			
		||||
//#define __LONG_MAX  0x7fffffffffffffffL /* max value for a long */
 | 
			
		||||
//#define __LONG_MIN  (-0x7fffffffffffffffL-1)  /* min value for a long */
 | 
			
		||||
#define __ULONG_MAX __UINT_MAX  /* max value for an unsigned long */
 | 
			
		||||
#define __LONG_MAX  __INT_MAX /* max value for a long */
 | 
			
		||||
#define __LONG_MIN  __INT_MIN  /* min value for a long */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define SSIZE_MAX LONG_MAX  /* max value for a ssize_t */
 | 
			
		||||
 | 
			
		||||
#define __ULLONG_MAX  0xffffffffffffffffULL /* max unsigned long long */
 | 
			
		||||
#define __LLONG_MAX 0x7fffffffffffffffLL  /* max signed long long */
 | 
			
		||||
#define __LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
 | 
			
		||||
 | 
			
		||||
#define SIZE_T_MAX  __ULLONG_MAX /* max value for a size_t */
 | 
			
		||||
 | 
			
		||||
/* GCC requires that quad constants be written as expressions. */
 | 
			
		||||
#define UQUAD_MAX ((u_quad_t)0-1) /* max value for a uquad_t */
 | 
			
		||||
          /* max value for a quad_t */
 | 
			
		||||
#define QUAD_MAX  ((quad_t)(UQUAD_MAX >> 1))
 | 
			
		||||
#define QUAD_MIN  (-QUAD_MAX-1) /* min value for a quad_t */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define LONG_BIT  32
 | 
			
		||||
#define WORD_BIT  32
 | 
			
		||||
 | 
			
		||||
/* Intel extensions to <limits.h> for UEFI */
 | 
			
		||||
#define __SHORT_BIT     16
 | 
			
		||||
#define __WCHAR_BIT     16
 | 
			
		||||
#define __INT_BIT       32
 | 
			
		||||
#define __LONG_BIT      32    /* Compiler dependent */
 | 
			
		||||
#define __LONG_LONG_BIT 64
 | 
			
		||||
#define __POINTER_BIT   64
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_LIMITS_H_ */
 | 
			
		||||
							
								
								
									
										97
									
								
								StdLib/Include/Ipf/machine/loadfile_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								StdLib/Include/Ipf/machine/loadfile_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,97 @@
 | 
			
		||||
/*	$NetBSD: loadfile_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	 */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Christos Zoulas and Ross Harvey.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define BOOT_ELF64
 | 
			
		||||
 | 
			
		||||
#define LOAD_KERNEL	(LOAD_ALL & ~LOAD_TEXTA)
 | 
			
		||||
#define COUNT_KERNEL	(COUNT_ALL & ~COUNT_TEXTA)
 | 
			
		||||
 | 
			
		||||
#ifndef MD_LOADSEG
 | 
			
		||||
/* XXX: Multiple unwind sections are ignored, and the last one found returned... Fixme! */
 | 
			
		||||
extern	vaddr_t ia64_unwindtab;
 | 
			
		||||
extern	vsize_t ia64_unwindtablen;
 | 
			
		||||
#define MD_LOADSEG(phdr) ((phdr)->p_type == PT_IA_64_UNWIND ? ia64_unwindtab = (phdr)->p_vaddr, ia64_unwindtablen = (phdr)->p_filesz, 1 : 0)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef _STANDALONE
 | 
			
		||||
 | 
			
		||||
/* XXX: cherry: This whole thing is glue between the NetBSD pread/vpbcopy etc. etc
 | 
			
		||||
 *      and the FreeBSD kern_pread/bzero etc. etc. Needs to be cleaned up 
 | 
			
		||||
 *      after discussion.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "bootstrap.h"
 | 
			
		||||
 | 
			
		||||
#define LOADADDR(a)		((a) + offset)
 | 
			
		||||
#define ALIGNENTRY(a)		Error! alpha supports ECOFF and ELF only! /* Fixme: for ia64 */
 | 
			
		||||
#define READ(f, b, c)		pread((f), LOADADDR(b), (c))
 | 
			
		||||
#define BCOPY(s, d, c)		vpbcopy((s), LOADADDR(d), (c))
 | 
			
		||||
#define BZERO(d, c)		pbzero(LOADADDR(d), (c))
 | 
			
		||||
#define	WARN(a)			(void)(printf a, \
 | 
			
		||||
				    printf((errno ? ": %s\n" : "\n"), \
 | 
			
		||||
				    strerror(errno)))
 | 
			
		||||
#define PROGRESS(a)		(void) printf a
 | 
			
		||||
#define ALLOC(a)		alloc(a)
 | 
			
		||||
#define DEALLOC(a, b)		dealloc(a, b)
 | 
			
		||||
#define OKMAGIC(a)		Error! ia64 supports ELF only!
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* XXX: defines below glues NetBSD conventions with bootstrap.h. */
 | 
			
		||||
 | 
			
		||||
#define	vpbcopy archsw.arch_copyin
 | 
			
		||||
#define	pbzero  kern_bzero
 | 
			
		||||
#define pread archsw.arch_readin
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#define LOADADDR(a)		(((u_long)(a)) + offset)
 | 
			
		||||
#define ALIGNENTRY(a)		((u_long)(a))
 | 
			
		||||
#define READ(f, b, c)		read((f), (void *)LOADADDR(b), (c))
 | 
			
		||||
#define BCOPY(s, d, c)		memcpy((void *)LOADADDR(d), (void *)(s), (c))
 | 
			
		||||
#define BZERO(d, c)		memset((void *)LOADADDR(d), 0, (c))
 | 
			
		||||
#define WARN(a)			warn a
 | 
			
		||||
#define PROGRESS(a)		/* nothing */
 | 
			
		||||
#define ALLOC(a)		malloc(a)
 | 
			
		||||
#define DEALLOC(a, b)		free(a)
 | 
			
		||||
#define OKMAGIC(a)		((a) == OMAGIC)
 | 
			
		||||
 | 
			
		||||
ssize_t vread(int, u_long, u_long *, size_t);
 | 
			
		||||
void vcopy(u_long, u_long, u_long *, size_t);
 | 
			
		||||
void vzero(u_long, u_long *, size_t);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										6
									
								
								StdLib/Include/Ipf/machine/math.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								StdLib/Include/Ipf/machine/math.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,6 @@
 | 
			
		||||
/*  $NetBSD: math.h,v 1.3 2005/12/11 12:16:25 christos Exp $  */
 | 
			
		||||
 | 
			
		||||
//#include <x86/math.h>
 | 
			
		||||
 | 
			
		||||
//#define __HAVE_LONG_DOUBLE
 | 
			
		||||
//#define __HAVE_NANF
 | 
			
		||||
							
								
								
									
										248
									
								
								StdLib/Include/Ipf/machine/mca_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										248
									
								
								StdLib/Include/Ipf/machine/mca_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,248 @@
 | 
			
		||||
/*	$NetBSD: mca_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2002 Marcel Moolenaar
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 *
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_MCA_H_
 | 
			
		||||
#define _MACHINE_MCA_H_
 | 
			
		||||
 | 
			
		||||
struct mca_record_header {
 | 
			
		||||
	uint64_t	rh_seqnr;		/* Record id. */
 | 
			
		||||
	uint8_t		rh_major;		/* BCD (=02). */
 | 
			
		||||
	uint8_t		rh_minor;		/* BCD (=00). */
 | 
			
		||||
	uint8_t		rh_error;		/* Error severity. */
 | 
			
		||||
#define	MCA_RH_ERROR_RECOVERABLE	0
 | 
			
		||||
#define	MCA_RH_ERROR_FATAL		1
 | 
			
		||||
#define	MCA_RH_ERROR_CORRECTED		2
 | 
			
		||||
	uint8_t		rh_flags;
 | 
			
		||||
#define	MCA_RH_FLAGS_PLATFORM_ID	0x01	/* Platform_id present. */
 | 
			
		||||
	uint32_t	rh_length;		/* Size including header. */
 | 
			
		||||
	uint8_t		rh_time[8];
 | 
			
		||||
#define	MCA_RH_TIME_SEC		0
 | 
			
		||||
#define	MCA_RH_TIME_MIN		1
 | 
			
		||||
#define	MCA_RH_TIME_HOUR	2
 | 
			
		||||
#define	MCA_RH_TIME_MDAY	4
 | 
			
		||||
#define	MCA_RH_TIME_MON		5
 | 
			
		||||
#define	MCA_RH_TIME_YEAR	6
 | 
			
		||||
#define	MCA_RH_TIME_CENT	7
 | 
			
		||||
	struct uuid	rh_platform;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_section_header {
 | 
			
		||||
	struct uuid	sh_uuid;
 | 
			
		||||
	uint8_t		sh_major;		/* BCD (=02). */
 | 
			
		||||
	uint8_t		sh_minor;		/* BCD (=00). */
 | 
			
		||||
	uint8_t		sh_flags;
 | 
			
		||||
#define	MCA_SH_FLAGS_CORRECTED	0x01		/* Error has been corrected. */
 | 
			
		||||
#define	MCA_SH_FLAGS_PROPAGATE	0x02		/* Possible propagation. */
 | 
			
		||||
#define	MCA_SH_FLAGS_RESET	0x04		/* Reset device before use. */
 | 
			
		||||
#define	MCA_SH_FLAGS_VALID	0x80		/* Flags are valid. */
 | 
			
		||||
	uint8_t		__reserved;
 | 
			
		||||
	uint32_t	sh_length;		/* Size including header. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_cpu_record {
 | 
			
		||||
	uint64_t	cpu_flags;
 | 
			
		||||
#define	MCA_CPU_FLAGS_ERRMAP		(1ULL << 0)
 | 
			
		||||
#define	MCA_CPU_FLAGS_STATE		(1ULL << 1)
 | 
			
		||||
#define	MCA_CPU_FLAGS_CR_LID		(1ULL << 2)
 | 
			
		||||
#define	MCA_CPU_FLAGS_PSI_STRUCT	(1ULL << 3)
 | 
			
		||||
#define	MCA_CPU_FLAGS_CACHE(x)		(((x) >> 4) & 15)
 | 
			
		||||
#define	MCA_CPU_FLAGS_TLB(x)		(((x) >> 8) & 15)
 | 
			
		||||
#define	MCA_CPU_FLAGS_BUS(x)		(((x) >> 12) & 15)
 | 
			
		||||
#define	MCA_CPU_FLAGS_REG(x)		(((x) >> 16) & 15)
 | 
			
		||||
#define	MCA_CPU_FLAGS_MS(x)		(((x) >> 20) & 15)
 | 
			
		||||
#define	MCA_CPU_FLAGS_CPUID		(1ULL << 24)
 | 
			
		||||
	uint64_t	cpu_errmap;
 | 
			
		||||
	uint64_t	cpu_state;
 | 
			
		||||
	uint64_t	cpu_cr_lid;
 | 
			
		||||
	/* Nx cpu_mod (cache). */
 | 
			
		||||
	/* Nx cpu_mod (TLB). */
 | 
			
		||||
	/* Nx cpu_mod (bus). */
 | 
			
		||||
	/* Nx cpu_mod (reg). */
 | 
			
		||||
	/* Nx cpu_mod (MS). */
 | 
			
		||||
	/* cpu_cpuid. */
 | 
			
		||||
	/* cpu_psi. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_cpu_cpuid {
 | 
			
		||||
	uint64_t	cpuid[6];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_cpu_mod {
 | 
			
		||||
	uint64_t	cpu_mod_flags;
 | 
			
		||||
#define	MCA_CPU_MOD_FLAGS_INFO	(1ULL << 0)
 | 
			
		||||
#define	MCA_CPU_MOD_FLAGS_REQID	(1ULL << 1)
 | 
			
		||||
#define	MCA_CPU_MOD_FLAGS_RSPID	(1ULL << 2)
 | 
			
		||||
#define	MCA_CPU_MOD_FLAGS_TGTID	(1ULL << 3)
 | 
			
		||||
#define	MCA_CPU_MOD_FLAGS_IP	(1ULL << 4)
 | 
			
		||||
	uint64_t	cpu_mod_info;
 | 
			
		||||
	uint64_t	cpu_mod_reqid;
 | 
			
		||||
	uint64_t	cpu_mod_rspid;
 | 
			
		||||
	uint64_t	cpu_mod_tgtid;
 | 
			
		||||
	uint64_t	cpu_mod_ip;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_cpu_psi {
 | 
			
		||||
	uint64_t	cpu_psi_flags;
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_STATE	(1ULL << 0)
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_BR	(1ULL << 1)
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_CR	(1ULL << 2)
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_AR	(1ULL << 3)
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_RR	(1ULL << 4)
 | 
			
		||||
#define	MCA_CPU_PSI_FLAGS_FR	(1ULL << 5)
 | 
			
		||||
	uint8_t		cpu_psi_state[1024];	/* XXX variable? */
 | 
			
		||||
	uint64_t	cpu_psi_br[8];
 | 
			
		||||
	uint64_t	cpu_psi_cr[128];	/* XXX variable? */
 | 
			
		||||
	uint64_t	cpu_psi_ar[128];	/* XXX variable? */
 | 
			
		||||
	uint64_t	cpu_psi_rr[8];
 | 
			
		||||
	uint64_t	cpu_psi_fr[256];	/* 16 bytes per register! */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_mem_record {
 | 
			
		||||
	uint64_t	mem_flags;
 | 
			
		||||
#define	MCA_MEM_FLAGS_STATUS		(1ULL << 0)
 | 
			
		||||
#define	MCA_MEM_FLAGS_ADDR		(1ULL << 1)
 | 
			
		||||
#define	MCA_MEM_FLAGS_ADDRMASK		(1ULL << 2)
 | 
			
		||||
#define	MCA_MEM_FLAGS_NODE		(1ULL << 3)
 | 
			
		||||
#define	MCA_MEM_FLAGS_CARD		(1ULL << 4)
 | 
			
		||||
#define	MCA_MEM_FLAGS_MODULE		(1ULL << 5)
 | 
			
		||||
#define	MCA_MEM_FLAGS_BANK		(1ULL << 6)
 | 
			
		||||
#define	MCA_MEM_FLAGS_DEVICE		(1ULL << 7)
 | 
			
		||||
#define	MCA_MEM_FLAGS_ROW		(1ULL << 8)
 | 
			
		||||
#define	MCA_MEM_FLAGS_COLUMN		(1ULL << 9)
 | 
			
		||||
#define	MCA_MEM_FLAGS_BITPOS		(1ULL << 10)
 | 
			
		||||
#define	MCA_MEM_FLAGS_REQID		(1ULL << 11)
 | 
			
		||||
#define	MCA_MEM_FLAGS_RSPID		(1ULL << 12)
 | 
			
		||||
#define	MCA_MEM_FLAGS_TGTID		(1ULL << 13)
 | 
			
		||||
#define	MCA_MEM_FLAGS_BUSDATA		(1ULL << 14)
 | 
			
		||||
#define	MCA_MEM_FLAGS_OEM_ID		(1ULL << 15)
 | 
			
		||||
#define	MCA_MEM_FLAGS_OEM_DATA		(1ULL << 16)
 | 
			
		||||
	uint64_t	mem_status;
 | 
			
		||||
	uint64_t	mem_addr;
 | 
			
		||||
	uint64_t	mem_addrmask;
 | 
			
		||||
	uint16_t	mem_node;
 | 
			
		||||
	uint16_t	mem_card;
 | 
			
		||||
	uint16_t	mem_module;
 | 
			
		||||
	uint16_t	mem_bank;
 | 
			
		||||
	uint16_t	mem_device;
 | 
			
		||||
	uint16_t	mem_row;
 | 
			
		||||
	uint16_t	mem_column;
 | 
			
		||||
	uint16_t	mem_bitpos;
 | 
			
		||||
	uint64_t	mem_reqid;
 | 
			
		||||
	uint64_t	mem_rspid;
 | 
			
		||||
	uint64_t	mem_tgtid;
 | 
			
		||||
	uint64_t	mem_busdata;
 | 
			
		||||
	struct uuid	mem_oem_id;
 | 
			
		||||
	uint16_t	mem_oem_length;		/* Size of OEM data. */
 | 
			
		||||
	/* N bytes of OEM platform data. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_pcibus_record {
 | 
			
		||||
	uint64_t	pcibus_flags;
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_STATUS		(1ULL << 0)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_ERROR		(1ULL << 1)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_BUS		(1ULL << 2)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_ADDR		(1ULL << 3)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_DATA		(1ULL << 4)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_CMD		(1ULL << 5)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_REQID		(1ULL << 6)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_RSPID		(1ULL << 7)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_TGTID		(1ULL << 8)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_OEM_ID		(1ULL << 9)
 | 
			
		||||
#define	MCA_PCIBUS_FLAGS_OEM_DATA	(1ULL << 10)
 | 
			
		||||
	uint64_t	pcibus_status;
 | 
			
		||||
	uint16_t	pcibus_error;
 | 
			
		||||
	uint16_t	pcibus_bus;
 | 
			
		||||
	uint32_t	__reserved;
 | 
			
		||||
	uint64_t	pcibus_addr;
 | 
			
		||||
	uint64_t	pcibus_data;
 | 
			
		||||
	uint64_t	pcibus_cmd;
 | 
			
		||||
	uint64_t	pcibus_reqid;
 | 
			
		||||
	uint64_t	pcibus_rspid;
 | 
			
		||||
	uint64_t	pcibus_tgtid;
 | 
			
		||||
	struct uuid	pcibus_oem_id;
 | 
			
		||||
	uint16_t	pcibus_oem_length;	/* Size of OEM data. */
 | 
			
		||||
	/* N bytes of OEM platform data. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_pcidev_record {
 | 
			
		||||
	uint64_t	pcidev_flags;
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_STATUS		(1ULL << 0)
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_INFO		(1ULL << 1)
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_REG_MEM	(1ULL << 2)
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_REG_IO		(1ULL << 3)
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_REG_DATA	(1ULL << 4)
 | 
			
		||||
#define	MCA_PCIDEV_FLAGS_OEM_DATA	(1ULL << 5)
 | 
			
		||||
	uint64_t	pcidev_status;
 | 
			
		||||
	struct {
 | 
			
		||||
		uint16_t	info_vendor;
 | 
			
		||||
		uint16_t	info_device;
 | 
			
		||||
		uint32_t	info_ccfn;	/* Class code & funct. nr. */
 | 
			
		||||
#define	MCA_PCIDEV_INFO_CLASS(x)	((x) & 0xffffff)
 | 
			
		||||
#define	MCA_PCIDEV_INFO_FUNCTION(x)	(((x) >> 24) & 0xff)
 | 
			
		||||
		uint8_t		info_slot;
 | 
			
		||||
		uint8_t		info_bus;
 | 
			
		||||
		uint8_t		info_segment;
 | 
			
		||||
		uint8_t		__res0;
 | 
			
		||||
		uint32_t	__res1;
 | 
			
		||||
	} pcidev_info;
 | 
			
		||||
	uint32_t	pcidev_reg_mem;
 | 
			
		||||
	uint32_t	pcidev_reg_io;
 | 
			
		||||
	/* Nx pcidev_reg. */
 | 
			
		||||
	/* M bytes of OEM platform data. */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct mca_pcidev_reg {
 | 
			
		||||
	uint64_t	pcidev_reg_addr;
 | 
			
		||||
	uint64_t	pcidev_reg_data;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	MCA_UUID_CPU		\
 | 
			
		||||
	{0xe429faf1,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_MEMORY		\
 | 
			
		||||
	{0xe429faf2,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_SEL		\
 | 
			
		||||
	{0xe429faf3,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_PCI_BUS	\
 | 
			
		||||
	{0xe429faf4,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_SMBIOS		\
 | 
			
		||||
	{0xe429faf5,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_PCI_DEV	\
 | 
			
		||||
	{0xe429faf6,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
#define	MCA_UUID_GENERIC	\
 | 
			
		||||
	{0xe429faf7,0x3cb7,0x11d4,0xbc,0xa7,{0x00,0x80,0xc7,0x3c,0x88,0x81}}
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
void ia64_mca_init(void);
 | 
			
		||||
void ia64_mca_save_state(int);
 | 
			
		||||
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_MCA_H_ */
 | 
			
		||||
							
								
								
									
										95
									
								
								StdLib/Include/Ipf/machine/md_var.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								StdLib/Include/Ipf/machine/md_var.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,95 @@
 | 
			
		||||
/*	$NetBSD: md_var.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1998 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_MD_VAR_H_
 | 
			
		||||
#define	_IA64_MD_VAR_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Miscellaneous machine-dependent declarations.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct ia64_fdesc {
 | 
			
		||||
	uint64_t	func;
 | 
			
		||||
	uint64_t	gp;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define FDESC_FUNC(fn)  (((struct ia64_fdesc *) fn)->func)
 | 
			
		||||
#define FDESC_GP(fn)    (((struct ia64_fdesc *) fn)->gp)
 | 
			
		||||
 | 
			
		||||
/* Convenience macros to decompose CFM & ar.pfs. */
 | 
			
		||||
#define	IA64_CFM_SOF(x)		((x) & 0x7f)
 | 
			
		||||
#define	IA64_CFM_SOL(x)		(((x) >> 7) & 0x7f)
 | 
			
		||||
#define	IA64_CFM_SOR(x)		(((x) >> 14) & 0x0f)
 | 
			
		||||
#define	IA64_CFM_RRB_GR(x)	(((x) >> 18) & 0x7f)
 | 
			
		||||
#define	IA64_CFM_RRB_FR(x)	(((x) >> 25) & 0x7f)
 | 
			
		||||
#define	IA64_CFM_RRB_PR(x)	(((x) >> 32) & 0x3f)
 | 
			
		||||
 | 
			
		||||
#define IA64_RNATINDEX(x)	(((x) & 0x1f8) >> 3)
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
extern	char	sigcode[];
 | 
			
		||||
extern	char	esigcode[];
 | 
			
		||||
extern	int	szsigcode;
 | 
			
		||||
extern	long	Maxmem;
 | 
			
		||||
extern	vaddr_t kernstart, kernend;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct _special;
 | 
			
		||||
struct fpreg;
 | 
			
		||||
struct reg;
 | 
			
		||||
struct thread;
 | 
			
		||||
struct trapframe;
 | 
			
		||||
 | 
			
		||||
void	busdma_swi(void);
 | 
			
		||||
int	copyout_regstack(struct thread *, uint64_t *, uint64_t *);
 | 
			
		||||
void	cpu_mp_add(u_int, u_int, u_int);
 | 
			
		||||
int	do_ast(struct trapframe *);
 | 
			
		||||
void	ia32_trap(int, struct trapframe *);
 | 
			
		||||
int	ia64_count_cpus(void);
 | 
			
		||||
void	ia64_flush_dirty(struct thread *, struct _special *);
 | 
			
		||||
uint64_t ia64_get_hcdp(void);
 | 
			
		||||
int	ia64_highfp_drop(struct thread *);
 | 
			
		||||
int	ia64_highfp_save(struct thread *);
 | 
			
		||||
void	ia64_init(void);
 | 
			
		||||
void	ia64_probe_sapics(void);
 | 
			
		||||
int	interrupt(uint64_t, struct trapframe *);
 | 
			
		||||
void	map_gateway_page(void);
 | 
			
		||||
void	map_pal_code(void);
 | 
			
		||||
void	os_boot_rendez(void);
 | 
			
		||||
void	os_mca(void);
 | 
			
		||||
int	syscall(struct trapframe *);
 | 
			
		||||
void	trap(int, struct trapframe *);
 | 
			
		||||
void	trap_panic(int, struct trapframe *);
 | 
			
		||||
int	unaligned_fixup(struct trapframe *, struct thread *);
 | 
			
		||||
 | 
			
		||||
#endif	/* _KERNEL */
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_MD_VAR_H_ */
 | 
			
		||||
							
								
								
									
										111
									
								
								StdLib/Include/Ipf/machine/pal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								StdLib/Include/Ipf/machine/pal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,111 @@
 | 
			
		||||
/*	$NetBSD: pal.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2000 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	$FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_PAL_H_
 | 
			
		||||
#define _MACHINE_PAL_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Architected static calling convention procedures.
 | 
			
		||||
 */
 | 
			
		||||
#define PAL_CACHE_FLUSH		1
 | 
			
		||||
#define PAL_CACHE_INFO		2
 | 
			
		||||
#define PAL_CACHE_INIT		3
 | 
			
		||||
#define PAL_CACHE_SUMMARY	4
 | 
			
		||||
#define PAL_MEM_ATTRIB		5
 | 
			
		||||
#define PAL_PTCE_INFO		6
 | 
			
		||||
#define PAL_VM_INFO		7
 | 
			
		||||
#define PAL_VM_SUMMARY		8
 | 
			
		||||
#define PAL_BUS_GET_FEATURES	9
 | 
			
		||||
#define PAL_BUS_SET_FEATURES	10
 | 
			
		||||
#define PAL_DEBUG_INFO		11
 | 
			
		||||
#define PAL_FIXED_ADDR		12
 | 
			
		||||
#define PAL_FREQ_BASE		13
 | 
			
		||||
#define PAL_FREQ_RATIOS		14
 | 
			
		||||
#define PAL_PERF_MON_INFO	15
 | 
			
		||||
#define PAL_PLATFORM_ADDR	16
 | 
			
		||||
#define PAL_PROC_GET_FEATURE	17
 | 
			
		||||
#define PAL_PROC_SET_FEATURE	18
 | 
			
		||||
#define PAL_RSE_INFO		19
 | 
			
		||||
#define PAL_VERSION		20
 | 
			
		||||
#define PAL_MC_CLEAR_LOG	21
 | 
			
		||||
#define PAL_MC_DRAIN		22
 | 
			
		||||
#define PAL_MC_DYNAMIC_STATE	24
 | 
			
		||||
#define PAL_MC_ERROR_INFO	25
 | 
			
		||||
#define PAL_MC_EXPECTED		23
 | 
			
		||||
#define PAL_MC_REGISTER_MEM	27
 | 
			
		||||
#define PAL_MC_RESUME		26
 | 
			
		||||
#define PAL_HALT		28
 | 
			
		||||
#define PAL_HALT_LIGHT		29
 | 
			
		||||
#define PAL_COPY_INFO		30
 | 
			
		||||
#define PAL_CACHE_LINE_INIT	31
 | 
			
		||||
#define PAL_PMI_ENTRYPOINT	32
 | 
			
		||||
#define PAL_ENTER_IA_32_ENV	33
 | 
			
		||||
#define PAL_VM_PAGE_SIZE	34
 | 
			
		||||
#define PAL_MEM_FOR_TEST	37
 | 
			
		||||
#define PAL_CACHE_PROT_INFO	38
 | 
			
		||||
#define PAL_REGISTER_INFO	39
 | 
			
		||||
#define PAL_SHUTDOWN		40
 | 
			
		||||
#define PAL_PREFETCH_VISIBILITY	41
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Architected stacked calling convention procedures.
 | 
			
		||||
 */
 | 
			
		||||
#define PAL_COPY_PAL		256
 | 
			
		||||
#define PAL_HALT_INFO		257
 | 
			
		||||
#define PAL_TEST_PROC		258
 | 
			
		||||
#define PAL_CACHE_READ		259
 | 
			
		||||
#define PAL_CACHE_WRITE		260
 | 
			
		||||
#define PAL_VM_TR_READ		261
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Default physical address of the Processor Interrupt Block (PIB).
 | 
			
		||||
 * See also: IA-64 SDM, rev 1.1, volume 2, page 5-31.
 | 
			
		||||
 */
 | 
			
		||||
#define	PAL_PIB_DEFAULT_ADDR	0x00000000FEE00000L
 | 
			
		||||
 | 
			
		||||
struct ia64_pal_result {
 | 
			
		||||
	int64_t		pal_status;
 | 
			
		||||
	u_int64_t	pal_result[3];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern struct ia64_pal_result
 | 
			
		||||
	ia64_call_pal_static(u_int64_t proc, u_int64_t arg1,
 | 
			
		||||
			     u_int64_t arg2, u_int64_t arg3);
 | 
			
		||||
extern struct ia64_pal_result
 | 
			
		||||
	ia64_call_pal_static_physical(u_int64_t proc, u_int64_t arg1,
 | 
			
		||||
				      u_int64_t arg2, u_int64_t arg3);
 | 
			
		||||
extern struct ia64_pal_result
 | 
			
		||||
	ia64_call_pal_stacked(u_int64_t proc, u_int64_t arg1,
 | 
			
		||||
			      u_int64_t arg2, u_int64_t arg3);
 | 
			
		||||
extern struct ia64_pal_result
 | 
			
		||||
	ia64_call_pal_stacked_physical(u_int64_t proc, u_int64_t arg1,
 | 
			
		||||
				       u_int64_t arg2, u_int64_t arg3);
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_PAL_H_ */
 | 
			
		||||
							
								
								
									
										152
									
								
								StdLib/Include/Ipf/machine/param.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										152
									
								
								StdLib/Include/Ipf/machine/param.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,152 @@
 | 
			
		||||
/*	$NetBSD: param.h,v 1.2 2006/08/28 13:43:35 yamt Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)param.h	5.8 (Berkeley) 6/28/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_PARAM_H_
 | 
			
		||||
#define _IA64_PARAM_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Machine dependent constants for Intel Itanium.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	_MACHINE	ia64
 | 
			
		||||
#define	MACHINE		"ia64"
 | 
			
		||||
#define	_MACHINE_ARCH	ia64
 | 
			
		||||
#define	MACHINE_ARCH	"ia64"
 | 
			
		||||
#define	MID_MACHINE	MID_IA64
 | 
			
		||||
 | 
			
		||||
#ifdef SMP
 | 
			
		||||
#define	MAXCPU		16
 | 
			
		||||
#else
 | 
			
		||||
#define MAXCPU		1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
 | 
			
		||||
#define	DEV_BSIZE	(1<<DEV_BSHIFT)
 | 
			
		||||
#define	BLKDEV_IOSIZE	2048
 | 
			
		||||
 | 
			
		||||
#ifndef MAXPHYS
 | 
			
		||||
#define MAXPHYS		(64 * 1024)	/* max raw I/O transfer size */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define UPAGES		4
 | 
			
		||||
#define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
 | 
			
		||||
 | 
			
		||||
#ifndef MSGBUFSIZE
 | 
			
		||||
#define MSGBUFSIZE	NBPG		/* default message buffer size */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef	KSTACK_PAGES
 | 
			
		||||
#define	KSTACK_PAGES	4		/* pages of kernel stack */
 | 
			
		||||
#endif
 | 
			
		||||
#define	KSTACK_GUARD_PAGES 0		/* pages of kstack guard; 0 disables */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Round p (pointer or byte index) up to a correctly-aligned value
 | 
			
		||||
 * for all data types (int, long, ...).   The result is u_int and
 | 
			
		||||
 * must be cast to any desired pointer type.
 | 
			
		||||
 *
 | 
			
		||||
 * ALIGNED_POINTER is a boolean macro that checks whether an address
 | 
			
		||||
 * is valid to fetch data elements of type t from on this architecture.
 | 
			
		||||
 * This does not reflect the optimal alignment, just the possibility
 | 
			
		||||
 * (within reasonable limits). 
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	ALIGNBYTES		15
 | 
			
		||||
#define	ALIGN(p)		(((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES)
 | 
			
		||||
#define ALIGNED_POINTER(p,t)	((((u_long)(p)) & (sizeof(t)-1)) == 0)
 | 
			
		||||
 | 
			
		||||
#define ALIGNBYTES32		(sizeof(int) - 1)
 | 
			
		||||
#define ALIGN32(p)		(((u_long)(p) + ALIGNBYTES32) &~ALIGNBYTES32)
 | 
			
		||||
 | 
			
		||||
#define	PGSHIFT		14		/* LOG2(NBPG) */
 | 
			
		||||
#define	NBPG		(1 << PGSHIFT)	/* bytes/page */
 | 
			
		||||
#define	PGOFSET		(NBPG-1)	/* byte offset into page */
 | 
			
		||||
#define	NPTEPG		(NBPG/(sizeof (pt_entry_t)))
 | 
			
		||||
/*
 | 
			
		||||
 * Constants related to network buffer management.
 | 
			
		||||
 * MCLBYTES must be no larger than NBPG (the software page size), and,
 | 
			
		||||
 * on machines that exchange pages of input or output buffers with mbuf
 | 
			
		||||
 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
 | 
			
		||||
 * of the hardware page size.
 | 
			
		||||
 */
 | 
			
		||||
#define	MSIZE		256		/* size of an mbuf */
 | 
			
		||||
 | 
			
		||||
#ifndef MCLSHIFT
 | 
			
		||||
#define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
 | 
			
		||||
					/* 2K cluster can hold Ether frame */
 | 
			
		||||
#endif	/* MCLSHIFT */
 | 
			
		||||
 | 
			
		||||
#define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
 | 
			
		||||
 | 
			
		||||
#ifndef NMBCLUSTERS
 | 
			
		||||
#if defined(_KERNEL_OPT)
 | 
			
		||||
#include "opt_gateway.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GATEWAY
 | 
			
		||||
#define	NMBCLUSTERS	2048		/* map size, max cluster allocation */
 | 
			
		||||
#else
 | 
			
		||||
#define	NMBCLUSTERS	1024		/* map size, max cluster allocation */
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
 | 
			
		||||
 * logical pages.
 | 
			
		||||
 */
 | 
			
		||||
#define	NKMEMPAGES_MIN_DEFAULT	((12 * 1024 * 1024) >> PAGE_SHIFT)
 | 
			
		||||
#define	NKMEMPAGES_MAX_DEFAULT	((128 * 1024 * 1024) >> PAGE_SHIFT)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Mach derived conversion macros
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define ia64_round_page(x)   ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG - 1))
 | 
			
		||||
#define ia64_trunc_page(x)   ((unsigned long)(x) & ~(NBPG - 1))
 | 
			
		||||
                
 | 
			
		||||
#define ia64_btop(x)            ((unsigned long)(x) >> PGSHIFT)
 | 
			
		||||
#define ia64_ptob(x)            ((unsigned long)(x) << PGSHIFT) 
 | 
			
		||||
                
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
#include <machine/intr.h>
 | 
			
		||||
 | 
			
		||||
#endif /* _LOCORE */
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
 | 
			
		||||
#endif /* _IA64_PARAM_H_ */
 | 
			
		||||
							
								
								
									
										78
									
								
								StdLib/Include/Ipf/machine/pcb.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								StdLib/Include/Ipf/machine/pcb.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,78 @@
 | 
			
		||||
/*	$NetBSD: pcb.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2003,2004 Marcel Moolenaar
 | 
			
		||||
 * Copyright (c) 2000 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	$FreeBSD: src/sys/ia64/include/pcb.h,v 1.16 2004/08/16 19:05:08 marcel Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_PCB_H_
 | 
			
		||||
#define _IA64_PCB_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/_regset.h>
 | 
			
		||||
#include <sys/lock.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * PCB: process control block
 | 
			
		||||
 */
 | 
			
		||||
struct pmap;
 | 
			
		||||
struct pcb {
 | 
			
		||||
	struct _special		pcb_special;
 | 
			
		||||
	struct _callee_saved	pcb_preserved;
 | 
			
		||||
	struct _callee_saved_fp	pcb_preserved_fp;
 | 
			
		||||
	struct _high_fp		pcb_high_fp;
 | 
			
		||||
	struct pcpu		*pcb_fpcpu;
 | 
			
		||||
	struct simplelock	pcb_fpcpu_slock;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/* IA32 specific registers. */
 | 
			
		||||
	uint64_t		pcb_ia32_cflg;
 | 
			
		||||
	uint64_t		pcb_ia32_eflag;
 | 
			
		||||
	uint64_t		pcb_ia32_fcr;
 | 
			
		||||
	uint64_t		pcb_ia32_fdr;
 | 
			
		||||
	uint64_t		pcb_ia32_fir;
 | 
			
		||||
	uint64_t		pcb_ia32_fsr;
 | 
			
		||||
 | 
			
		||||
	uint64_t		pcb_onfault;	/* for copy faults */
 | 
			
		||||
  //	struct pmap 		*pcb_current_pmap;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
#define	savectx(p)	swapctx(p, NULL)
 | 
			
		||||
 | 
			
		||||
struct trapframe;
 | 
			
		||||
 | 
			
		||||
void makectx(struct trapframe *, struct pcb *);
 | 
			
		||||
/*void restorectx(struct pcb *) __dead2;*/
 | 
			
		||||
int swapctx(struct pcb *old, struct pcb *new);
 | 
			
		||||
 | 
			
		||||
void ia32_restorectx(struct pcb *);
 | 
			
		||||
void ia32_savectx(struct pcb *);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _IA64_PCB_H_ */
 | 
			
		||||
							
								
								
									
										162
									
								
								StdLib/Include/Ipf/machine/pmap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										162
									
								
								StdLib/Include/Ipf/machine/pmap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,162 @@
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 | 
			
		||||
 * NASA Ames Research Center and by Chris G. Demetriou.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *	This product includes software developed by the NetBSD
 | 
			
		||||
 *	Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1991 Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * the Systems Programming Group of the University of Utah Computer
 | 
			
		||||
 * Science Department and William Jolitz of UUNET Technologies Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 4. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * Derived from hp300 version by Mike Hibler, this version by William
 | 
			
		||||
 * Jolitz uses a recursive map [a pde points to the page directory] to
 | 
			
		||||
 * map the page tables using the pagetables themselves. This is done to
 | 
			
		||||
 * reduce the impact on kernel virtual memory for lots of sparse address
 | 
			
		||||
 * space, and to reduce the cost of memory to each process.
 | 
			
		||||
 *
 | 
			
		||||
 *	from: hp300: @(#)pmap.h	7.2 (Berkeley) 12/16/90
 | 
			
		||||
 *	from: @(#)pmap.h	7.4 (Berkeley) 5/12/91
 | 
			
		||||
 *	from: i386 pmap.h,v 1.54 1997/11/20 19:30:35 bde Exp
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/pmap.h,v 1.25 2005/09/03 23:53:50 marcel Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _PMAP_MACHINE_
 | 
			
		||||
#define _PMAP_MACHINE_
 | 
			
		||||
 | 
			
		||||
#include <sys/lock.h>
 | 
			
		||||
 | 
			
		||||
paddr_t vtophys(vaddr_t);
 | 
			
		||||
 | 
			
		||||
struct pv_entry;	/* Forward declaration. */
 | 
			
		||||
 | 
			
		||||
struct pmap {
 | 
			
		||||
	TAILQ_ENTRY(pmap)	pm_list;	/* list of all pmaps */
 | 
			
		||||
	TAILQ_HEAD(,pv_entry)	pm_pvlist;	/* list of mappings in pmap */
 | 
			
		||||
	int			pm_count;	/* pmap reference count */
 | 
			
		||||
	struct simplelock	pm_slock;	/* lock on pmap */
 | 
			
		||||
	u_int32_t		pm_rid[5];	/* base RID for pmap */
 | 
			
		||||
	int			pm_active;	/* active flag */
 | 
			
		||||
	struct pmap_statistics	pm_stats;	/* pmap statistics */
 | 
			
		||||
	unsigned long		pm_cpus;	/* mask of CPUs using pmap */
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct pmap	*pmap_t;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * For each vm_page_t, there is a list of all currently valid virtual
 | 
			
		||||
 * mappings of that page.  An entry is a pv_entry_t, the list is pv_pvlist.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct pv_entry {
 | 
			
		||||
	pmap_t		pv_pmap;	/* pmap where mapping lies */
 | 
			
		||||
	vaddr_t		pv_va;		/* virtual address for mapping */
 | 
			
		||||
	TAILQ_ENTRY(pv_entry)	pv_list;
 | 
			
		||||
	TAILQ_ENTRY(pv_entry)	pv_plist;
 | 
			
		||||
} *pv_entry_t;
 | 
			
		||||
 | 
			
		||||
/* pvh_attrs */
 | 
			
		||||
#define	PGA_MODIFIED		0x01		/* modified */
 | 
			
		||||
#define	PGA_REFERENCED		0x02		/* referenced */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern struct pmap	kernel_pmap_store;
 | 
			
		||||
 | 
			
		||||
#define pmap_kernel()			(&kernel_pmap_store)
 | 
			
		||||
 | 
			
		||||
#define	pmap_resident_count(pmap)	((pmap)->pm_stats.resident_count)
 | 
			
		||||
#define	pmap_wired_count(pmap)		((pmap)->pm_stats.wired_count)
 | 
			
		||||
 | 
			
		||||
#define	pmap_copy(dp, sp, da, l, sa)	/* nothing */
 | 
			
		||||
#define	pmap_update(pmap)		/* nothing (yet) */
 | 
			
		||||
 | 
			
		||||
void pmap_bootstrap(void);
 | 
			
		||||
 | 
			
		||||
#define	pmap_is_referenced(pg)						\
 | 
			
		||||
	(((pg)->mdpage.pvh_attrs & PGA_REFERENCED) != 0)
 | 
			
		||||
#define	pmap_is_modified(pg)						\
 | 
			
		||||
	(((pg)->mdpage.pvh_attrs & PGA_MODIFIED) != 0)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define PMAP_STEAL_MEMORY		/* enable pmap_steal_memory() */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Alternate mapping hooks for pool pages.  Avoids thrashing the TLB.
 | 
			
		||||
 */
 | 
			
		||||
#define	PMAP_MAP_POOLPAGE(pa)		IA64_PHYS_TO_RR7((pa))
 | 
			
		||||
#define	PMAP_UNMAP_POOLPAGE(va)		IA64_RR_MASK((va))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Macros for locking pmap structures.
 | 
			
		||||
 *
 | 
			
		||||
 * Note that we if we access the kernel pmap in interrupt context, it
 | 
			
		||||
 * is only to update statistics.  Since stats are updated using atomic
 | 
			
		||||
 * operations, locking the kernel pmap is not necessary.  Therefore,
 | 
			
		||||
 * it is not necessary to block interrupts when locking pmap strucutres.
 | 
			
		||||
 */
 | 
			
		||||
#define	PMAP_LOCK(pmap)		simple_lock(&(pmap)->pm_slock)
 | 
			
		||||
#define	PMAP_UNLOCK(pmap)	simple_unlock(&(pmap)->pm_slock)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define PMAP_VHPT_LOG2SIZE 16 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* _PMAP_MACHINE_ */
 | 
			
		||||
							
								
								
									
										110
									
								
								StdLib/Include/Ipf/machine/pte.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										110
									
								
								StdLib/Include/Ipf/machine/pte.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,110 @@
 | 
			
		||||
/*	$NetBSD: pte.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_PTE_H_
 | 
			
		||||
#define	_MACHINE_PTE_H_
 | 
			
		||||
 | 
			
		||||
#define	PTE_PRESENT	0x0000000000000001
 | 
			
		||||
#define	PTE__RV1_	0x0000000000000002
 | 
			
		||||
#define	PTE_MA_MASK	0x000000000000001C
 | 
			
		||||
#define	PTE_MA_WB	0x0000000000000000
 | 
			
		||||
#define	PTE_MA_UC	0x0000000000000010
 | 
			
		||||
#define	PTE_MA_UCE	0x0000000000000014
 | 
			
		||||
#define	PTE_MA_WC	0x0000000000000018
 | 
			
		||||
#define	PTE_MA_NATPAGE	0x000000000000001C
 | 
			
		||||
#define	PTE_ACCESSED	0x0000000000000020
 | 
			
		||||
#define	PTE_DIRTY	0x0000000000000040
 | 
			
		||||
#define	PTE_PL_MASK	0x0000000000000180
 | 
			
		||||
#define	PTE_PL_KERN	0x0000000000000000
 | 
			
		||||
#define	PTE_PL_USER	0x0000000000000180
 | 
			
		||||
#define	PTE_AR_MASK	0x0000000000000E00
 | 
			
		||||
 | 
			
		||||
#define	PTE_AR_R	0x0000000000000000
 | 
			
		||||
#define	PTE_AR_RX	0x0000000000000200
 | 
			
		||||
#define	PTE_AR_RW	0x0000000000000400
 | 
			
		||||
#define	PTE_AR_RWX	0x0000000000000600
 | 
			
		||||
#define	PTE_AR_R_RW	0x0000000000000800
 | 
			
		||||
#define	PTE_AR_RX_RWX	0x0000000000000A00
 | 
			
		||||
#define	PTE_AR_RWX_RW	0x0000000000000C00
 | 
			
		||||
#define	PTE_AR_X_RX	0x0000000000000E00
 | 
			
		||||
#define	PTE_PPN_MASK	0x0003FFFFFFFFF000
 | 
			
		||||
#define	PTE__RV2_	0x000C000000000000
 | 
			
		||||
#define	PTE_ED		0x0010000000000000
 | 
			
		||||
#define	PTE_IG_MASK	0xFFE0000000000000
 | 
			
		||||
#define	PTE_WIRED	0x0020000000000000
 | 
			
		||||
#define	PTE_MANAGED	0x0040000000000000
 | 
			
		||||
#define	PTE_PROT_MASK	0x0700000000000000
 | 
			
		||||
 | 
			
		||||
#define	ITIR__RV1_	0x0000000000000003
 | 
			
		||||
#define	ITIR_PS_MASK	0x00000000000000FC
 | 
			
		||||
#define	ITIR_KEY_MASK	0x00000000FFFFFF00
 | 
			
		||||
#define	ITIR__RV2_	0xFFFFFFFF00000000
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
typedef uint64_t pt_entry_t;
 | 
			
		||||
 | 
			
		||||
static __inline pt_entry_t
 | 
			
		||||
pte_atomic_clear(pt_entry_t *ptep, uint64_t val)
 | 
			
		||||
{
 | 
			
		||||
	return (atomic_clear_64(ptep, val));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline pt_entry_t
 | 
			
		||||
pte_atomic_set(pt_entry_t *ptep, uint64_t val)
 | 
			
		||||
{
 | 
			
		||||
	return (atomic_set_64(ptep, val));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * A long-format VHPT entry.
 | 
			
		||||
 */
 | 
			
		||||
struct ia64_lpte {
 | 
			
		||||
        pt_entry_t      pte;
 | 
			
		||||
        uint64_t        itir;
 | 
			
		||||
        uint64_t        tag;            /* includes ti */
 | 
			
		||||
        uint64_t        chain;          /* pa of collision chain */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Layout of rr[x].
 | 
			
		||||
 */
 | 
			
		||||
struct ia64_rr {
 | 
			
		||||
	uint64_t	rr_ve	:1;	/* bit 0 */
 | 
			
		||||
	uint64_t	__rv1__	:1;	/* bit 1 */
 | 
			
		||||
	uint64_t	rr_ps	:6;	/* bits 2..7 */
 | 
			
		||||
	uint64_t	rr_rid	:24;	/* bits 8..31 */
 | 
			
		||||
	uint64_t	__rv2__	:32;	/* bits 32..63 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif /* !LOCORE */
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_PTE_H_ */
 | 
			
		||||
							
								
								
									
										40
									
								
								StdLib/Include/Ipf/machine/ptrace.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								StdLib/Include/Ipf/machine/ptrace.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
/*	$NetBSD: ptrace.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 1994 Christopher G. Demetriou
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *      This product includes software developed by Christopher G. Demetriou.
 | 
			
		||||
 * 4. The name of the author may not be used to endorse or promote products
 | 
			
		||||
 *    derived from this software without specific prior written permission
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 | 
			
		||||
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 | 
			
		||||
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 | 
			
		||||
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 | 
			
		||||
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 | 
			
		||||
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 | 
			
		||||
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 | 
			
		||||
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 | 
			
		||||
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IA64 dependent ptrace definitions.
 | 
			
		||||
 */
 | 
			
		||||
#define	PT_STEP		(PT_FIRSTMACH + 0)
 | 
			
		||||
#define	PT_GETREGS	(PT_FIRSTMACH + 1)
 | 
			
		||||
#define	PT_SETREGS	(PT_FIRSTMACH + 2)
 | 
			
		||||
#define	PT_GETFPREGS	(PT_FIRSTMACH + 3)
 | 
			
		||||
#define	PT_SETFPREGS	(PT_FIRSTMACH + 4)
 | 
			
		||||
							
								
								
									
										53
									
								
								StdLib/Include/Ipf/machine/reg.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								StdLib/Include/Ipf/machine/reg.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,53 @@
 | 
			
		||||
/*	$NetBSD: reg.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2000 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	$FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_REG_H_
 | 
			
		||||
#define _IA64_REG_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/_regset.h>
 | 
			
		||||
 | 
			
		||||
struct reg {
 | 
			
		||||
	struct _special		r_special;
 | 
			
		||||
	struct _callee_saved	r_preserved;
 | 
			
		||||
	struct _caller_saved	r_scratch;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct fpreg {
 | 
			
		||||
	struct _callee_saved_fp	fpr_preserved;
 | 
			
		||||
	struct _caller_saved_fp	fpr_scratch;
 | 
			
		||||
	struct _high_fp		fpr_high;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct dbreg {
 | 
			
		||||
	unsigned long	dbr_data[8];
 | 
			
		||||
	unsigned long	dbr_inst[8];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif /* _IA64_REG_H_ */
 | 
			
		||||
							
								
								
									
										144
									
								
								StdLib/Include/Ipf/machine/sal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								StdLib/Include/Ipf/machine/sal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,144 @@
 | 
			
		||||
/*	$NetBSD: sal.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2001 Doug Rabson
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * $FreeBSD$
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_SAL_H_
 | 
			
		||||
#define _MACHINE_SAL_H_
 | 
			
		||||
 | 
			
		||||
struct sal_system_table {
 | 
			
		||||
	char		sal_signature[4];
 | 
			
		||||
#define	SAL_SIGNATURE	"SST_"
 | 
			
		||||
	u_int32_t	sal_length;
 | 
			
		||||
	u_int8_t	sal_rev[2];
 | 
			
		||||
	u_int16_t	sal_entry_count;
 | 
			
		||||
	u_int8_t	sal_checksum;
 | 
			
		||||
	u_int8_t	sal_reserved1[7];
 | 
			
		||||
	u_int8_t	sal_a_version[2];
 | 
			
		||||
	u_int8_t	sal_b_version[2];
 | 
			
		||||
	char		sal_oem_id[32];
 | 
			
		||||
	char		sal_product_id[32];
 | 
			
		||||
	u_int8_t	sal_reserved2[8];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_entrypoint_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 0 */
 | 
			
		||||
	u_int8_t	sale_reserved1[7];
 | 
			
		||||
	u_int64_t	sale_pal_proc;
 | 
			
		||||
	u_int64_t	sale_sal_proc;
 | 
			
		||||
	u_int64_t	sale_sal_gp;
 | 
			
		||||
	u_int8_t	sale_reserved2[16];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_memory_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 1 */
 | 
			
		||||
	u_int8_t	sale_need_virtual;
 | 
			
		||||
	u_int8_t	sale_current_attribute;
 | 
			
		||||
	u_int8_t	sale_access_rights;
 | 
			
		||||
	u_int8_t	sale_supported_attributes;
 | 
			
		||||
	u_int8_t	sale_reserved1;
 | 
			
		||||
	u_int8_t	sale_memory_type[2];
 | 
			
		||||
	u_int64_t	sale_physical_address;
 | 
			
		||||
	u_int32_t	sale_length;
 | 
			
		||||
	u_int8_t	sale_reserved2[12];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_platform_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 2 */
 | 
			
		||||
	u_int8_t	sale_features;
 | 
			
		||||
	u_int8_t	sale_reserved[14];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_tr_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 3 */
 | 
			
		||||
	u_int8_t	sale_register_type;
 | 
			
		||||
	u_int8_t	sale_register_number;
 | 
			
		||||
	u_int8_t	sale_reserved1[5];
 | 
			
		||||
	u_int64_t	sale_virtual_address;
 | 
			
		||||
	u_int64_t	sale_page_size;
 | 
			
		||||
	u_int8_t	sale_reserved2[8];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_ptc_cache_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 4 */
 | 
			
		||||
	u_int8_t	sale_reserved[3];
 | 
			
		||||
	u_int32_t	sale_domains;
 | 
			
		||||
	u_int64_t	sale_address;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct sal_ap_wakeup_descriptor {
 | 
			
		||||
	u_int8_t	sale_type;	/* == 5 */
 | 
			
		||||
	u_int8_t	sale_mechanism;
 | 
			
		||||
	u_int8_t	sale_reserved[6];
 | 
			
		||||
	u_int64_t	sale_vector;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * SAL Procedure numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define SAL_SET_VECTORS		0x01000000
 | 
			
		||||
#define SAL_GET_STATE_INFO	0x01000001
 | 
			
		||||
#define SAL_GET_STATE_INFO_SIZE	0x01000002
 | 
			
		||||
#define SAL_CLEAR_STATE_INFO	0x01000003
 | 
			
		||||
#define SAL_MC_RENDEZ		0x01000004
 | 
			
		||||
#define SAL_MC_SET_PARAMS	0x01000005
 | 
			
		||||
#define SAL_REGISTER_PHYSICAL_ADDR 0x01000006
 | 
			
		||||
#define SAL_CACHE_FLUSH		0x01000008
 | 
			
		||||
#define SAL_CACHE_INIT		0x01000009
 | 
			
		||||
#define SAL_PCI_CONFIG_READ	0x01000010
 | 
			
		||||
#define SAL_PCI_CONFIG_WRITE	0x01000011
 | 
			
		||||
#define SAL_FREQ_BASE		0x01000012
 | 
			
		||||
#define SAL_UPDATE_PAL		0x01000020
 | 
			
		||||
 | 
			
		||||
/* SAL_SET_VECTORS event handler types */
 | 
			
		||||
#define	SAL_OS_MCA		0
 | 
			
		||||
#define	SAL_OS_INIT		1
 | 
			
		||||
#define	SAL_OS_BOOT_RENDEZ	2
 | 
			
		||||
 | 
			
		||||
/* SAL_GET_STATE_INFO, SAL_GET_STATE_INFO_SIZE types */
 | 
			
		||||
#define	SAL_INFO_MCA		0
 | 
			
		||||
#define	SAL_INFO_INIT		1
 | 
			
		||||
#define	SAL_INFO_CMC		2
 | 
			
		||||
#define	SAL_INFO_CPE		3
 | 
			
		||||
#define	SAL_INFO_TYPES		4	/* number of types we know about */
 | 
			
		||||
 | 
			
		||||
struct ia64_sal_result {
 | 
			
		||||
	int64_t		sal_status;
 | 
			
		||||
	u_int64_t	sal_result[3];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef struct ia64_sal_result sal_entry_t
 | 
			
		||||
	(u_int64_t, u_int64_t, u_int64_t, u_int64_t,
 | 
			
		||||
	 u_int64_t, u_int64_t, u_int64_t, u_int64_t);
 | 
			
		||||
 | 
			
		||||
extern sal_entry_t *ia64_sal_entry;
 | 
			
		||||
 | 
			
		||||
extern void ia64_sal_init(void);
 | 
			
		||||
 | 
			
		||||
#endif /* _MACHINE_SAL_H_ */
 | 
			
		||||
							
								
								
									
										101
									
								
								StdLib/Include/Ipf/machine/setjmp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								StdLib/Include/Ipf/machine/setjmp.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,101 @@
 | 
			
		||||
/*	$NetBSD: setjmp.h,v 1.2 2006/09/10 21:16:56 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2000
 | 
			
		||||
 * Intel Corporation.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 * 
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 * 
 | 
			
		||||
 *    This product includes software developed by Intel Corporation and
 | 
			
		||||
 *    its contributors.
 | 
			
		||||
 * 
 | 
			
		||||
 * 4. Neither the name of Intel Corporation or its contributors may be
 | 
			
		||||
 *    used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 * 
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION AND CONTRIBUTORS ``AS IS''
 | 
			
		||||
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL INTEL CORPORATION OR CONTRIBUTORS BE
 | 
			
		||||
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 | 
			
		||||
 * THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 * 
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/setjmp.h,v 1.12 2003/07/26 08:03:43 marcel Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_SETJMP_H_
 | 
			
		||||
#define	_MACHINE_SETJMP_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/cdefs.h>
 | 
			
		||||
 | 
			
		||||
#define	JMPBUF_ADDR_OF(buf, item)	((unsigned long)((char *)buf + item))
 | 
			
		||||
 | 
			
		||||
#define	J_UNAT		0
 | 
			
		||||
#define	J_NATS		0x8
 | 
			
		||||
#define	J_PFS		0x10
 | 
			
		||||
#define	J_BSP		0x18
 | 
			
		||||
#define	J_RNAT		0x20
 | 
			
		||||
#define	J_PREDS		0x28
 | 
			
		||||
#define	J_LC		0x30
 | 
			
		||||
#define	J_R4		0x38
 | 
			
		||||
#define	J_R5		0x40
 | 
			
		||||
#define	J_R6		0x48
 | 
			
		||||
#define	J_R7		0x50
 | 
			
		||||
#define	J_SP		0x58
 | 
			
		||||
#define	J_F2		0x60
 | 
			
		||||
#define	J_F3		0x70
 | 
			
		||||
#define	J_F4		0x80
 | 
			
		||||
#define	J_F5		0x90
 | 
			
		||||
#define	J_F16		0xa0
 | 
			
		||||
#define	J_F17		0xb0
 | 
			
		||||
#define	J_F18		0xc0
 | 
			
		||||
#define	J_F19		0xd0
 | 
			
		||||
#define	J_F20		0xe0
 | 
			
		||||
#define	J_F21		0xf0
 | 
			
		||||
#define	J_F22		0x100
 | 
			
		||||
#define	J_F23		0x110
 | 
			
		||||
#define	J_F24		0x120
 | 
			
		||||
#define	J_F25		0x130
 | 
			
		||||
#define	J_F26		0x140
 | 
			
		||||
#define	J_F27		0x150
 | 
			
		||||
#define	J_F28		0x160
 | 
			
		||||
#define	J_F29		0x170
 | 
			
		||||
#define	J_F30		0x180
 | 
			
		||||
#define	J_F31		0x190
 | 
			
		||||
#define	J_FPSR		0x1a0
 | 
			
		||||
#define	J_B0		0x1a8
 | 
			
		||||
#define	J_B1		0x1b0
 | 
			
		||||
#define	J_B2		0x1b8
 | 
			
		||||
#define	J_B3		0x1c0
 | 
			
		||||
#define	J_B4		0x1c8
 | 
			
		||||
#define	J_B5		0x1d0
 | 
			
		||||
#define	J_SIGMASK	0x1d8
 | 
			
		||||
#define	J_SIGSET	0x1e0
 | 
			
		||||
 | 
			
		||||
#define	_JBLEN		0x200			/* Size in long XXX: Set to sizeof(mcontext_t)/sizeof(long) */
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
#ifdef CTASSERT
 | 
			
		||||
CTASSERT(sizeof(struct _jmp_buf) == 512);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_SETJMP_H_ */
 | 
			
		||||
							
								
								
									
										22
									
								
								StdLib/Include/Ipf/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								StdLib/Include/Ipf/machine/signal.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
/**
 | 
			
		||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
This program and the accompanying materials are licensed and made available under
 | 
			
		||||
the terms and conditions of the BSD License that accompanies this distribution.
 | 
			
		||||
The full text of the license may be found at
 | 
			
		||||
http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _MACHINE_SIGNAL_H
 | 
			
		||||
#define _MACHINE_SIGNAL_H
 | 
			
		||||
#include <sys/EfiCdefs.h>
 | 
			
		||||
 | 
			
		||||
/** The type sig_atomic_t is the (possibly volatile-qualified) integer type of
 | 
			
		||||
    an object that can be accessed as an atomic entity, even in the presence
 | 
			
		||||
    of asynchronous interrupts.
 | 
			
		||||
**/
 | 
			
		||||
typedef INTN sig_atomic_t;
 | 
			
		||||
 | 
			
		||||
#endif    /* _MACHINE_SIGNAL_H */
 | 
			
		||||
							
								
								
									
										40
									
								
								StdLib/Include/Ipf/machine/smp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								StdLib/Include/Ipf/machine/smp.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,40 @@
 | 
			
		||||
/*
 | 
			
		||||
 * $FreeBSD: src/sys/ia64/include/smp.h,v 1.10 2005/08/06 20:28:19 marcel Exp $
 | 
			
		||||
 */
 | 
			
		||||
#ifndef _MACHINE_SMP_H_
 | 
			
		||||
#define _MACHINE_SMP_H_
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Interprocessor interrupts for SMP. The following values are indices
 | 
			
		||||
 * into the IPI vector table. The SAL gives us the vector used for AP
 | 
			
		||||
 * wake-up. We base the other vectors on that. Keep IPI_AP_WAKEUP at
 | 
			
		||||
 * index 0 and IPI_MCA_RENDEZ at index 1. See sal.c for details.
 | 
			
		||||
 */
 | 
			
		||||
/* Architecture specific IPIs. */
 | 
			
		||||
#define	IPI_AP_WAKEUP		0
 | 
			
		||||
#define	IPI_HIGH_FP		1
 | 
			
		||||
#define	IPI_MCA_CMCV		2
 | 
			
		||||
#define	IPI_MCA_RENDEZ		3
 | 
			
		||||
#define	IPI_TEST		4
 | 
			
		||||
/* Machine independent IPIs. */
 | 
			
		||||
#define	IPI_AST			5
 | 
			
		||||
#define	IPI_RENDEZVOUS		6
 | 
			
		||||
#define	IPI_STOP		7
 | 
			
		||||
 | 
			
		||||
#define	IPI_COUNT		8
 | 
			
		||||
 | 
			
		||||
#ifndef LOCORE
 | 
			
		||||
 | 
			
		||||
extern int ipi_vector[];
 | 
			
		||||
 | 
			
		||||
void	ipi_all(int ipi);
 | 
			
		||||
void	ipi_all_but_self(int ipi);
 | 
			
		||||
void	ipi_selected(u_int64_t cpus, int ipi);
 | 
			
		||||
void	ipi_self(int ipi);
 | 
			
		||||
void	ipi_send(u_int64_t lid, int ipi);
 | 
			
		||||
 | 
			
		||||
#endif /* !LOCORE */
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
#endif /* !_MACHINE_SMP_H */
 | 
			
		||||
							
								
								
									
										18
									
								
								StdLib/Include/Ipf/machine/ssc.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								StdLib/Include/Ipf/machine/ssc.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,18 @@
 | 
			
		||||
/*	$NetBSD: ssc.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
#define SSC_CONSOLE_INIT		20
 | 
			
		||||
#define SSC_GETCHAR			21
 | 
			
		||||
#define SSC_PUTCHAR			31
 | 
			
		||||
#define SSC_OPEN			50
 | 
			
		||||
#define SSC_CLOSE			51
 | 
			
		||||
#define SSC_READ			52
 | 
			
		||||
#define SSC_WRITE			53
 | 
			
		||||
#define SSC_GET_COMPLETION		54
 | 
			
		||||
#define SSC_WAIT_COMPLETION		55
 | 
			
		||||
#define SSC_GET_RTC			65
 | 
			
		||||
#define SSC_EXIT			66
 | 
			
		||||
#define SSC_LOAD_SYMBOLS		69
 | 
			
		||||
#define	SSC_SAL_SET_VECTORS		120
 | 
			
		||||
 | 
			
		||||
u_int64_t
 | 
			
		||||
ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which);
 | 
			
		||||
							
								
								
									
										61
									
								
								StdLib/Include/Ipf/machine/stdarg.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								StdLib/Include/Ipf/machine/stdarg.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,61 @@
 | 
			
		||||
/*	$NetBSD: stdarg.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1991, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)stdarg.h	8.1 (Berkeley) 6/10/93
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_STDARG_H_
 | 
			
		||||
#define	_IA64_STDARG_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/ansi.h>
 | 
			
		||||
#include <sys/featuretest.h>
 | 
			
		||||
 | 
			
		||||
typedef _BSD_VA_LIST_	va_list;
 | 
			
		||||
 | 
			
		||||
#ifdef __lint__
 | 
			
		||||
#define __builtin_next_arg(t)		((t) ? 0 : 0)
 | 
			
		||||
#define	__builtin_stdarg_start(a, l)	((a) = (va_list)(void *)&(l))
 | 
			
		||||
#define	__builtin_va_arg(a, t)		((a) ? (t) 0 : (t) 0)
 | 
			
		||||
#define	__builtin_va_end(a)		/* nothing */
 | 
			
		||||
#define	__builtin_va_copy(d, s)		((d) = (s))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	va_start(ap, last)	__builtin_stdarg_start((ap), (last))
 | 
			
		||||
#define	va_arg			__builtin_va_arg
 | 
			
		||||
#define	va_end(ap)		__builtin_va_end(ap)
 | 
			
		||||
#define	__va_copy(dest, src)	__builtin_va_copy((dest), (src))
 | 
			
		||||
 | 
			
		||||
#if !defined(_ANSI_SOURCE) && \
 | 
			
		||||
    (defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
 | 
			
		||||
     defined(_NETBSD_SOURCE))
 | 
			
		||||
#define	va_copy(dest, src)	__va_copy((dest), (src))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_STDARG_H_ */
 | 
			
		||||
							
								
								
									
										64
									
								
								StdLib/Include/Ipf/machine/types.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								StdLib/Include/Ipf/machine/types.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,64 @@
 | 
			
		||||
/*  $NetBSD: types.h,v 1.2 2006/09/10 21:30:14 gdamore Exp $  */
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *  @(#)types.h 7.5 (Berkeley) 3/9/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHTYPES_H_
 | 
			
		||||
#define _MACHTYPES_H_
 | 
			
		||||
#include <sys/EfiCdefs.h>
 | 
			
		||||
#include <sys/featuretest.h>
 | 
			
		||||
#include <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/* Handle the long and unsigned long data types which EFI doesn't directly support */
 | 
			
		||||
//typedef INTN              LONGN;
 | 
			
		||||
//typedef UINTN             ULONGN;
 | 
			
		||||
 | 
			
		||||
typedef PHYSICAL_ADDRESS  paddr_t;
 | 
			
		||||
typedef UINT64            psize_t;
 | 
			
		||||
typedef PHYSICAL_ADDRESS  vaddr_t;
 | 
			
		||||
typedef UINT64            vsize_t;
 | 
			
		||||
 | 
			
		||||
typedef INTN              pmc_evid_t;
 | 
			
		||||
typedef UINT64            pmc_ctr_t;
 | 
			
		||||
typedef INTN              register_t;
 | 
			
		||||
 | 
			
		||||
typedef __volatile INT32    __cpu_simple_lock_t;
 | 
			
		||||
 | 
			
		||||
#define __SIMPLELOCK_LOCKED 1
 | 
			
		||||
#define __SIMPLELOCK_UNLOCKED 0
 | 
			
		||||
 | 
			
		||||
#define __HAVE_CPU_COUNTER
 | 
			
		||||
#define __HAVE_SYSCALL_INTERN
 | 
			
		||||
#define __HAVE_MINIMAL_EMUL
 | 
			
		||||
#define __HAVE_OLD_DISKLABEL
 | 
			
		||||
/* XXX: #define __HAVE_CPU_MAXPROC */
 | 
			
		||||
 | 
			
		||||
#endif  /* _MACHTYPES_H_ */
 | 
			
		||||
							
								
								
									
										52
									
								
								StdLib/Include/Ipf/machine/varargs.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								StdLib/Include/Ipf/machine/varargs.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
/*	$NetBSD: varargs.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990, 1993
 | 
			
		||||
 *	The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 * (c) UNIX System Laboratories, Inc.
 | 
			
		||||
 * All or some portions of this file are derived from material licensed
 | 
			
		||||
 * to the University of California by American Telephone and Telegraph
 | 
			
		||||
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
 | 
			
		||||
 * the permission of UNIX System Laboratories, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)varargs.h	8.2 (Berkeley) 3/22/94
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_VARARGS_H_
 | 
			
		||||
#define	_IA64_VARARGS_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/stdarg.h>
 | 
			
		||||
 | 
			
		||||
#define	__va_ellipsis	...
 | 
			
		||||
#define	__va_alist_t	__builtin_va_alist_t
 | 
			
		||||
#define	va_alist	__builtin_va_alist
 | 
			
		||||
#define	va_dcl		__va_alist_t __builtin_va_alist; __va_ellipsis
 | 
			
		||||
 | 
			
		||||
#undef va_start
 | 
			
		||||
#define	va_start(ap)	__builtin_varargs_start((ap))
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_VARARGS_H_ */
 | 
			
		||||
							
								
								
									
										132
									
								
								StdLib/Include/Ipf/machine/vmparam.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										132
									
								
								StdLib/Include/Ipf/machine/vmparam.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,132 @@
 | 
			
		||||
/*	$NetBSD: vmparam.h,v 1.2 2006/07/03 17:01:45 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)vmparam.h	5.9 (Berkeley) 5/12/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _VMPARAM_H_
 | 
			
		||||
#define _VMPARAM_H_
 | 
			
		||||
 | 
			
		||||
#include <sys/tree.h>
 | 
			
		||||
 | 
			
		||||
#define	USRSTACK	VM_MAX_ADDRESS /* XXX: Revisit vm address space. */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Virtual memory related constants, all in bytes
 | 
			
		||||
 */
 | 
			
		||||
#ifndef MAXTSIZ
 | 
			
		||||
#define	MAXTSIZ		(1<<30)			/* max text size (1G) */
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef DFLDSIZ
 | 
			
		||||
#define	DFLDSIZ		(1<<27)			/* initial data size (128M) */
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef MAXDSIZ
 | 
			
		||||
#define	MAXDSIZ		(1<<30)			/* max data size (1G) */
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef	DFLSSIZ
 | 
			
		||||
#define	DFLSSIZ		(1<<21)			/* initial stack size (2M) */
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef	MAXSSIZ
 | 
			
		||||
#define	MAXSSIZ		(1<<28)			/* max stack size (256M) */
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef SGROWSIZ
 | 
			
		||||
#define SGROWSIZ	(128UL*1024)		/* amount to grow stack */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * PTEs for mapping user space into the kernel for phyio operations.
 | 
			
		||||
 * 64 pte's are enough to cover 8 disks * MAXBSIZE.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef USRIOSIZE
 | 
			
		||||
#define USRIOSIZE	64
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Manipulating region bits of an address.
 | 
			
		||||
 */
 | 
			
		||||
#define IA64_RR_BASE(n)         (((u_int64_t) (n)) << 61)
 | 
			
		||||
#define IA64_RR_MASK(x)         ((x) & ((1L << 61) - 1))
 | 
			
		||||
 | 
			
		||||
#define IA64_PHYS_TO_RR6(x)     ((x) | IA64_RR_BASE(6))
 | 
			
		||||
#define IA64_PHYS_TO_RR7(x)     ((x) | IA64_RR_BASE(7))
 | 
			
		||||
 | 
			
		||||
#define	IA64_ID_PAGE_SHIFT	28		/* 256M */
 | 
			
		||||
#define	IA64_ID_PAGE_SIZE	(1 << IA64_ID_PAGE_SHIFT)
 | 
			
		||||
#define	IA64_ID_PAGE_MASK	(IA64_ID_PAGE_SIZE-1)
 | 
			
		||||
 | 
			
		||||
#define	IA64_BACKINGSTORE	IA64_RR_BASE(4)
 | 
			
		||||
 | 
			
		||||
#define	PAGE_SHIFT	14		/* 16K pages by default. */
 | 
			
		||||
#define	PAGE_SIZE	(1 << PAGE_SHIFT)
 | 
			
		||||
#define	PAGE_MASK	(PAGE_SIZE - 1)
 | 
			
		||||
 | 
			
		||||
/* user/kernel map constants */
 | 
			
		||||
#define VM_MIN_ADDRESS		((vaddr_t)0)
 | 
			
		||||
#define	VM_MAX_ADDRESS		((vaddr_t) IA64_RR_BASE(5))
 | 
			
		||||
#define	VM_GATEWAY_SIZE		PAGE_SIZE
 | 
			
		||||
#define	VM_MAXUSER_ADDRESS	(VM_MAX_ADDRESS + VM_GATEWAY_SIZE)
 | 
			
		||||
#define	VM_MIN_KERNEL_ADDRESS	VM_MAXUSER_ADDRESS
 | 
			
		||||
#define VM_MAX_KERNEL_ADDRESS	((vaddr_t) (IA64_RR_BASE(6) - 1))
 | 
			
		||||
 | 
			
		||||
#define VM_PHYSSEG_MAX		16		/* XXX: */
 | 
			
		||||
#define VM_PHYSSEG_STRAT	VM_PSTRAT_BSEARCH
 | 
			
		||||
#define	VM_PHYSSEG_NOADD			/* no more after vm_mem_init */
 | 
			
		||||
 | 
			
		||||
#define	VM_NFREELIST		1 /* XXX: */
 | 
			
		||||
#define	VM_FREELIST_DEFAULT	0 /* XXX: */
 | 
			
		||||
 | 
			
		||||
/* virtual sizes (bytes) for various kernel submaps */
 | 
			
		||||
#define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
/*
 | 
			
		||||
 * pmap-specific data store in the vm_page structure.
 | 
			
		||||
 */
 | 
			
		||||
#define	__HAVE_VM_PAGE_MD
 | 
			
		||||
struct vm_page_md {
 | 
			
		||||
	TAILQ_HEAD(,pv_entry) pv_list;		/* pv_entry list */
 | 
			
		||||
	int pv_list_count;
 | 
			
		||||
	struct simplelock pv_slock;		/* lock on this head */
 | 
			
		||||
	int pvh_attrs;				/* page attributes */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define	VM_MDPAGE_INIT(pg)						\
 | 
			
		||||
do {									\
 | 
			
		||||
	TAILQ_INIT(&(pg)->mdpage.pv_list);				\
 | 
			
		||||
	simple_lock_init(&(pg)->mdpage.pv_slock);			\
 | 
			
		||||
} while (/*CONSTCOND*/0)
 | 
			
		||||
#endif /*_LOCORE*/
 | 
			
		||||
 | 
			
		||||
#endif /* _VMPARAM_H_ */
 | 
			
		||||
							
								
								
									
										42
									
								
								StdLib/Include/Ipf/machine/wchar_limits.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								StdLib/Include/Ipf/machine/wchar_limits.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,42 @@
 | 
			
		||||
/*	$NetBSD: wchar_limits.h,v 1.1 2006/04/07 14:21:18 cherry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 2004 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Klaus Klein.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _IA64_WCHAR_LIMITS_H_
 | 
			
		||||
#define _IA64_WCHAR_LIMITS_H_
 | 
			
		||||
 | 
			
		||||
#endif /* !_IA64_WCHAR_LIMITS_H_ */
 | 
			
		||||
							
								
								
									
										103
									
								
								StdLib/Include/X64/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								StdLib/Include/X64/machine/ansi.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,103 @@
 | 
			
		||||
/** @file
 | 
			
		||||
    Machine dependent ANSI type definitions.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
			
		||||
    This program and the accompanying materials are licensed and made available
 | 
			
		||||
    under the terms and conditions of the BSD License that accompanies this
 | 
			
		||||
    distribution.  The full text of the license may be found at
 | 
			
		||||
    http://opensource.org/licenses/bsd-license.php.
 | 
			
		||||
 | 
			
		||||
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 | 
			
		||||
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 1990, 1993
 | 
			
		||||
    The Regents of the University of California.  All rights reserved.
 | 
			
		||||
 | 
			
		||||
    Redistribution and use in source and binary forms, with or without
 | 
			
		||||
    modification, are permitted provided that the following conditions
 | 
			
		||||
    are met:
 | 
			
		||||
      - Redistributions of source code must retain the above copyright
 | 
			
		||||
        notice, this list of conditions and the following disclaimer.
 | 
			
		||||
      - Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
        notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
        documentation and/or other materials provided with the distribution.
 | 
			
		||||
      - Neither the name of the University nor the names of its contributors
 | 
			
		||||
        may be used to endorse or promote products derived from this software
 | 
			
		||||
        without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 | 
			
		||||
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
    ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
 | 
			
		||||
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
    POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
    NetBSD: ansi.h,v 1.4 2006/10/04 13:51:59 tnozaki Exp
 | 
			
		||||
    ansi.h  8.2 (Berkeley) 1/4/94
 | 
			
		||||
**/
 | 
			
		||||
#ifndef _ANSI_H_
 | 
			
		||||
#define _ANSI_H_
 | 
			
		||||
 | 
			
		||||
#include  <sys/EfiCdefs.h>
 | 
			
		||||
 | 
			
		||||
#include  <machine/int_types.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types which are fundamental to the implementation and may appear in
 | 
			
		||||
 * more than one standard header are defined here.  Standard headers
 | 
			
		||||
 * then use:
 | 
			
		||||
 *  #ifdef  _BSD_SIZE_T_
 | 
			
		||||
 *  typedef _BSD_SIZE_T_ size_t;
 | 
			
		||||
 *  #undef  _BSD_SIZE_T_
 | 
			
		||||
 *  #endif
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_CLOCK_T_     _EFI_CLOCK_T      /* clock() */
 | 
			
		||||
#define _BSD_PTRDIFF_T_   _EFI_PTRDIFF_T_   /* ptr1 - ptr2 */
 | 
			
		||||
#define _BSD_SIZE_T_      _EFI_SIZE_T_      /* sizeof() */
 | 
			
		||||
#define _BSD_SSIZE_T_     INTN              /* byte count or error */
 | 
			
		||||
#define _BSD_TIME_T_      _EFI_TIME_T       /* time() */
 | 
			
		||||
#define _BSD_VA_LIST_     VA_LIST
 | 
			
		||||
#define _BSD_CLOCKID_T_   INT64             /* clockid_t */
 | 
			
		||||
#define _BSD_TIMER_T_     INT64             /* timer_t */
 | 
			
		||||
#define _BSD_SUSECONDS_T_ INT64             /* suseconds_t */
 | 
			
		||||
#define _BSD_USECONDS_T_  UINT64            /* useconds_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NOTE: rune_t is not covered by ANSI nor other standards, and should not
 | 
			
		||||
 * be instantiated outside of lib/libc/locale.  use wchar_t.
 | 
			
		||||
 *
 | 
			
		||||
 * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
 | 
			
		||||
 * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
 | 
			
		||||
 * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
 | 
			
		||||
 * it looks like 10646 will be a 31 bit standard.  This means that if your
 | 
			
		||||
 * ints cannot hold 32 bits, you will be in trouble.  The reason an int was
 | 
			
		||||
 * chosen over a long is that the is*() and to*() routines take ints (says
 | 
			
		||||
 * ANSI C), but they use _RUNE_T_ instead of int.  By changing it here, you
 | 
			
		||||
 * lose a bit of ANSI conformance, but your programs will still work.
 | 
			
		||||
 *
 | 
			
		||||
 * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.  When wchar_t
 | 
			
		||||
 * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
 | 
			
		||||
 * defined for ctype.h.
 | 
			
		||||
 */
 | 
			
		||||
#define _BSD_WCHAR_T_     _EFI_WCHAR_T    /* wchar_t */
 | 
			
		||||
#define _BSD_WINT_T_      _EFI_WINT_T     /* wint_t */
 | 
			
		||||
#define _BSD_RUNE_T_      _EFI_WCHAR_T    /* rune_t */
 | 
			
		||||
#define _BSD_WCTRANS_T_   void *          /* wctrans_t */
 | 
			
		||||
#define _BSD_WCTYPE_T_    unsigned int    /* wctype_t */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * mbstate_t is an opaque object to keep conversion state, during multibyte
 | 
			
		||||
 * stream conversions.  The content must not be referenced by user programs.
 | 
			
		||||
 */
 | 
			
		||||
typedef union {
 | 
			
		||||
  __int64_t __mbstateL; /* for alignment */
 | 
			
		||||
  char __mbstate8[128];
 | 
			
		||||
} __mbstate_t;
 | 
			
		||||
#define _BSD_MBSTATE_T_   __mbstate_t /* mbstate_t */
 | 
			
		||||
 | 
			
		||||
#endif  /* _ANSI_H_ */
 | 
			
		||||
							
								
								
									
										146
									
								
								StdLib/Include/X64/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								StdLib/Include/X64/machine/asm.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,146 @@
 | 
			
		||||
/*	$NetBSD: asm.h,v 1.6 2006/09/05 19:00:42 ad Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1990 The Regents of the University of California.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to Berkeley by
 | 
			
		||||
 * William Jolitz.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. Neither the name of the University nor the names of its contributors
 | 
			
		||||
 *    may be used to endorse or promote products derived from this software
 | 
			
		||||
 *    without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 | 
			
		||||
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 | 
			
		||||
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 | 
			
		||||
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 | 
			
		||||
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 | 
			
		||||
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 | 
			
		||||
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 | 
			
		||||
 * SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 *	@(#)asm.h	5.5 (Berkeley) 5/7/91
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _AMD64_ASM_H_
 | 
			
		||||
#define _AMD64_ASM_H_
 | 
			
		||||
 | 
			
		||||
#ifdef PIC
 | 
			
		||||
#define PIC_PLT(x)	x@PLT
 | 
			
		||||
#define PIC_GOT(x)	x@GOTPCREL(%rip)
 | 
			
		||||
#else
 | 
			
		||||
#define PIC_PLT(x)	x
 | 
			
		||||
#define PIC_GOT(x)	x
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
# define _C_LABEL(x)	x
 | 
			
		||||
#define	_ASM_LABEL(x)	x
 | 
			
		||||
 | 
			
		||||
#define CVAROFF(x,y)		(_C_LABEL(x)+y)(%rip)
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
# define __CONCAT(x,y)	x ## y
 | 
			
		||||
# define __STRING(x)	#x
 | 
			
		||||
#else
 | 
			
		||||
# define __CONCAT(x,y)	x/**/y
 | 
			
		||||
# define __STRING(x)	"x"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* let kernels and others override entrypoint alignment */
 | 
			
		||||
#ifndef _ALIGN_TEXT
 | 
			
		||||
#define _ALIGN_TEXT .align 4
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define _ENTRY(x) \
 | 
			
		||||
	.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
/* XXX Can't use __CONCAT() here, as it would be evaluated incorrectly. */
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl X ## name; .type X ## name,@function; X ## name:
 | 
			
		||||
#else 
 | 
			
		||||
#define	IDTVEC(name) \
 | 
			
		||||
	ALIGN_TEXT; .globl X/**/name; .type X/**/name,@function; X/**/name:
 | 
			
		||||
#endif /* __STDC__ */ 
 | 
			
		||||
#endif /* _KERNEL */
 | 
			
		||||
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define CPUVAR(off)	%gs:CPU_INFO_ ## off
 | 
			
		||||
#else
 | 
			
		||||
#define CPUVAR(off)     %gs:CPU_INFO_/**/off
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef GPROF
 | 
			
		||||
# define _PROF_PROLOGUE	\
 | 
			
		||||
	pushq %rbp; leaq (%rsp),%rbp; call PIC_PLT(__mcount); popq %rbp
 | 
			
		||||
#else
 | 
			
		||||
# define _PROF_PROLOGUE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
#define	NENTRY(y)	_ENTRY(_C_LABEL(y))
 | 
			
		||||
#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
 | 
			
		||||
 | 
			
		||||
#define	ASMSTR		.asciz
 | 
			
		||||
 | 
			
		||||
#define RCSID(x)	.text; .asciz x
 | 
			
		||||
 | 
			
		||||
#define	WEAK_ALIAS(alias,sym)						\
 | 
			
		||||
	.weak alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * STRONG_ALIAS: create a strong alias.
 | 
			
		||||
 */
 | 
			
		||||
#define STRONG_ALIAS(alias,sym)						\
 | 
			
		||||
	.globl alias;							\
 | 
			
		||||
	alias = sym
 | 
			
		||||
 | 
			
		||||
/* XXXfvdl do not use stabs here */
 | 
			
		||||
#ifdef __STDC__
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg ## ,30,0,0,0 ;					\
 | 
			
		||||
	.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
 | 
			
		||||
#else
 | 
			
		||||
#define	WARN_REFERENCES(sym,msg)					\
 | 
			
		||||
	.stabs msg,30,0,0,0 ;						\
 | 
			
		||||
	.stabs __STRING(sym),1,0,0,0
 | 
			
		||||
#endif /* __STDC__ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Assembley equivalent of spllower().  Label contains the label to jump to
 | 
			
		||||
 * if we need to fire off pending interrupts (e.g. _C_LABEL(Xspllower)).
 | 
			
		||||
 *
 | 
			
		||||
 * On entry %rcx = new SPL.
 | 
			
		||||
 */
 | 
			
		||||
#define	SPLLOWER(label)						\
 | 
			
		||||
	movq		CPUVAR(SELF), %r9 ;			\
 | 
			
		||||
	cmpl		CPU_INFO_ILEVEL(%r9), %ecx ;		\
 | 
			
		||||
	jae		99f ;					\
 | 
			
		||||
	movl		CPU_INFO_IUNMASK(%r9,%rcx,4), %edi ;	\
 | 
			
		||||
	pushfq		;					\
 | 
			
		||||
	popq		%rax ;					\
 | 
			
		||||
	cli		;					\
 | 
			
		||||
	testl		CPU_INFO_IPENDING(%r9), %edi ;		\
 | 
			
		||||
	movq		%rcx, %rdi ;				\
 | 
			
		||||
	jnz		label ;					\
 | 
			
		||||
	movl		%ecx, CPU_INFO_ILEVEL(%r9) ;		\
 | 
			
		||||
	pushq		%rax ;					\
 | 
			
		||||
	popfq		;					\
 | 
			
		||||
99:
 | 
			
		||||
 | 
			
		||||
#endif /* !_AMD64_ASM_H_ */
 | 
			
		||||
							
								
								
									
										95
									
								
								StdLib/Include/X64/machine/atomic.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								StdLib/Include/X64/machine/atomic.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,95 @@
 | 
			
		||||
/*	$NetBSD: atomic.h,v 1.4 2005/12/28 19:09:29 perry Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2002 (c) Wasabi Systems, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Written by Frank van der Linden for Wasabi Systems, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *      This product includes software developed for the NetBSD Project by
 | 
			
		||||
 *      Wasabi Systems, Inc.
 | 
			
		||||
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 | 
			
		||||
 *    or promote products derived from this software without specific prior
 | 
			
		||||
 *    written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 | 
			
		||||
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _ATOMIC_H
 | 
			
		||||
#define _ATOMIC_H
 | 
			
		||||
 | 
			
		||||
#ifndef _LOCORE
 | 
			
		||||
 | 
			
		||||
static __inline u_int64_t
 | 
			
		||||
x86_atomic_testset_u64(volatile u_int64_t *ptr, u_int64_t val) {
 | 
			
		||||
    __asm volatile ("xchgq %0,(%2)" :"=r" (val):"0" (val),"r" (ptr));
 | 
			
		||||
    return val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline u_int32_t
 | 
			
		||||
x86_atomic_testset_u32(volatile u_int32_t *ptr, u_int32_t val) {
 | 
			
		||||
    __asm volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr));
 | 
			
		||||
    return val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static __inline int32_t
 | 
			
		||||
x86_atomic_testset_i32(volatile int32_t *ptr, int32_t val) {
 | 
			
		||||
    __asm volatile ("xchgl %0,(%2)" :"=r" (val):"0" (val),"r" (ptr));
 | 
			
		||||
    return val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
x86_atomic_setbits_u32(volatile u_int32_t *ptr, u_int32_t bits) {
 | 
			
		||||
    __asm volatile("lock ; orl %1,%0" :  "=m" (*ptr) : "ir" (bits));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
x86_atomic_clearbits_u32(volatile u_int32_t *ptr, u_int32_t bits) {
 | 
			
		||||
    __asm volatile("lock ; andl %1,%0" :  "=m" (*ptr) : "ir" (~bits));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
x86_atomic_setbits_u64(volatile u_int64_t *ptr, u_int64_t bits) {
 | 
			
		||||
    __asm volatile("lock ; orq %1,%0" :  "=m" (*ptr) : "ir" (~bits));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static __inline void
 | 
			
		||||
x86_atomic_clearbits_u64(volatile u_int64_t *ptr, u_int64_t bits) {
 | 
			
		||||
    __asm volatile("lock ; andq %1,%0" :  "=m" (*ptr) : "ir" (~bits));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define x86_atomic_testset_ul	x86_atomic_testset_u32
 | 
			
		||||
#define x86_atomic_testset_i	x86_atomic_testset_i32
 | 
			
		||||
#define x86_atomic_setbits_l	x86_atomic_setbits_u32
 | 
			
		||||
#define x86_atomic_setbits_ul	x86_atomic_setbits_u32
 | 
			
		||||
#define x86_atomic_clearbits_l	x86_atomic_clearbits_u32
 | 
			
		||||
#define x86_atomic_clearbits_ul	x86_atomic_clearbits_u32
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										13
									
								
								StdLib/Include/X64/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								StdLib/Include/X64/machine/bswap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
/*      $NetBSD: bswap.h,v 1.2 2006/01/31 07:49:18 dsl Exp $      */
 | 
			
		||||
 | 
			
		||||
/* Written by Manuel Bouyer. Public domain */
 | 
			
		||||
 | 
			
		||||
#ifndef _MACHINE_BSWAP_H_
 | 
			
		||||
#define	_MACHINE_BSWAP_H_
 | 
			
		||||
 | 
			
		||||
#include <machine/byte_swap.h>
 | 
			
		||||
 | 
			
		||||
#define __BSWAP_RENAME
 | 
			
		||||
#include <sys/bswap.h>
 | 
			
		||||
 | 
			
		||||
#endif /* !_MACHINE_BSWAP_H_ */
 | 
			
		||||
							
								
								
									
										71
									
								
								StdLib/Include/X64/machine/byte_swap.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								StdLib/Include/X64/machine/byte_swap.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,71 @@
 | 
			
		||||
/*	$NetBSD: byte_swap.h,v 1.4 2006/01/30 22:46:35 dsl Exp $	*/
 | 
			
		||||
 | 
			
		||||
/*-
 | 
			
		||||
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * This code is derived from software contributed to The NetBSD Foundation
 | 
			
		||||
 * by Charles M. Hannum.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
 * are met:
 | 
			
		||||
 * 1. Redistributions of source code must retain the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer.
 | 
			
		||||
 * 2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *    notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *    documentation and/or other materials provided with the distribution.
 | 
			
		||||
 * 3. All advertising materials mentioning features or use of this software
 | 
			
		||||
 *    must display the following acknowledgement:
 | 
			
		||||
 *        This product includes software developed by the NetBSD
 | 
			
		||||
 *        Foundation, Inc. and its contributors.
 | 
			
		||||
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 | 
			
		||||
 *    contributors may be used to endorse or promote products derived
 | 
			
		||||
 *    from this software without specific prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 | 
			
		||||
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 | 
			
		||||
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 | 
			
		||||
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 | 
			
		||||
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 | 
			
		||||
 * POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copy of the i386 version. 64 bit versions may be added later.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _AMD64_BYTE_SWAP_H_
 | 
			
		||||
#define	_AMD64_BYTE_SWAP_H_
 | 
			
		||||
 | 
			
		||||
#ifdef  __GNUC__
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
__BEGIN_DECLS
 | 
			
		||||
 | 
			
		||||
#define	__BYTE_SWAP_U32_VARIABLE __byte_swap_u32_variable
 | 
			
		||||
static __inline uint32_t __byte_swap_u32_variable(uint32_t);
 | 
			
		||||
static __inline uint32_t
 | 
			
		||||
__byte_swap_u32_variable(uint32_t x)
 | 
			
		||||
{
 | 
			
		||||
	__asm volatile ( "bswap %1" : "=r" (x) : "0" (x));
 | 
			
		||||
	return (x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define	__BYTE_SWAP_U16_VARIABLE __byte_swap_u16_variable
 | 
			
		||||
static __inline uint16_t __byte_swap_u16_variable(uint16_t);
 | 
			
		||||
static __inline uint16_t
 | 
			
		||||
__byte_swap_u16_variable(uint16_t x)
 | 
			
		||||
{
 | 
			
		||||
	__asm volatile ("rorw $8, %w1" : "=r" (x) : "0" (x)); 
 | 
			
		||||
	return (x);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
__END_DECLS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* !_AMD64_BYTE_SWAP_H_ */
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/X64/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/X64/machine/endian.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $	*/
 | 
			
		||||
 | 
			
		||||
#include <sys/endian.h>
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/X64/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/X64/machine/endian_machdep.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*	$NetBSD: endian_machdep.h,v 1.4 2006/01/30 21:52:38 dsl Exp $	*/
 | 
			
		||||
 | 
			
		||||
#define _BYTE_ORDER _LITTLE_ENDIAN
 | 
			
		||||
							
								
								
									
										3
									
								
								StdLib/Include/X64/machine/float.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								StdLib/Include/X64/machine/float.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
/*  $NetBSD: float.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */
 | 
			
		||||
 | 
			
		||||
#include <x86/float.h>
 | 
			
		||||
							
								
								
									
										103
									
								
								StdLib/Include/X64/machine/fpu.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								StdLib/Include/X64/machine/fpu.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,103 @@
 | 
			
		||||
/*	$NetBSD: fpu.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $	*/
 | 
			
		||||
 | 
			
		||||
#ifndef	_AMD64_FPU_H_
 | 
			
		||||
#define	_AMD64_FPU_H_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * NetBSD/amd64 only uses the extended save/restore format used
 | 
			
		||||
 * by fxsave/fsrestore, to always deal with the SSE registers,
 | 
			
		||||
 * which are part of the ABI to pass floating point values.
 | 
			
		||||
 * Must be stored in memory on a 16-byte boundary.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct fxsave64 {
 | 
			
		||||
	u_int16_t  fx_fcw;
 | 
			
		||||
	u_int16_t  fx_fsw;
 | 
			
		||||
	u_int8_t   fx_ftw;
 | 
			
		||||
	u_int8_t   fx_unused1;
 | 
			
		||||
	u_int16_t  fx_fop;
 | 
			
		||||
	u_int64_t  fx_rip;
 | 
			
		||||
	u_int64_t  fx_rdp;
 | 
			
		||||
	u_int32_t  fx_mxcsr;
 | 
			
		||||
	u_int32_t  fx_mxcsr_mask;
 | 
			
		||||
	u_int64_t  fx_st[8][2];   /* 8 normal FP regs */
 | 
			
		||||
	u_int64_t  fx_xmm[16][2]; /* 16 SSE2 registers */
 | 
			
		||||
	u_int8_t   fx_unused3[96];
 | 
			
		||||
} __attribute__((packed));
 | 
			
		||||
 | 
			
		||||
struct savefpu {
 | 
			
		||||
	struct fxsave64 fp_fxsave;	/* see above */
 | 
			
		||||
	u_int16_t fp_ex_sw;		/* saved status from last exception */
 | 
			
		||||
	u_int16_t fp_ex_tw;		/* saved tag from last exception */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This one only used for backward compat coredumping.
 | 
			
		||||
 */
 | 
			
		||||
struct oldfsave {
 | 
			
		||||
	u_int16_t	fs_control;
 | 
			
		||||
	u_int16_t	fs_unused0;
 | 
			
		||||
	u_int16_t	fs_status;
 | 
			
		||||
	u_int16_t	fs_unused1;
 | 
			
		||||
	u_int16_t	fs_tag;
 | 
			
		||||
	u_int16_t	fs_unused2;
 | 
			
		||||
	u_int32_t	fs_ipoff;
 | 
			
		||||
	u_int16_t	fs_ipsel;
 | 
			
		||||
	u_int16_t	fs_op;
 | 
			
		||||
	u_int32_t	fs_opoff;
 | 
			
		||||
	u_int16_t	fs_opsel;
 | 
			
		||||
} __attribute__ ((packed));
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The i387 defaults to Intel extended precision mode and round to nearest,
 | 
			
		||||
 * with all exceptions masked.
 | 
			
		||||
 */
 | 
			
		||||
#define	__INITIAL_NPXCW__	0x037f
 | 
			
		||||
#define __INITIAL_MXCSR__ 	0x1f80
 | 
			
		||||
#define __INITIAL_MXCSR_MASK__	0xffbf
 | 
			
		||||
 | 
			
		||||
/* NetBSD uses IEEE double precision. */
 | 
			
		||||
#define	__NetBSD_NPXCW__	0x127f
 | 
			
		||||
/* Linux just uses the default control word. */
 | 
			
		||||
#define	__Linux_NPXCW__		0x037f
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The standard control word from finit is 0x37F, giving:
 | 
			
		||||
 *	round to nearest
 | 
			
		||||
 *	64-bit precision
 | 
			
		||||
 *	all exceptions masked.
 | 
			
		||||
 *
 | 
			
		||||
 * Now we want:
 | 
			
		||||
 *	affine mode (if we decide to support 287's)
 | 
			
		||||
 *	round to nearest
 | 
			
		||||
 *	53-bit precision
 | 
			
		||||
 *	all exceptions masked.
 | 
			
		||||
 *
 | 
			
		||||
 * 64-bit precision often gives bad results with high level languages
 | 
			
		||||
 * because it makes the results of calculations depend on whether
 | 
			
		||||
 * intermediate values are stored in memory or in FPU registers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef _KERNEL
 | 
			
		||||
/*
 | 
			
		||||
 * XXX
 | 
			
		||||
 */
 | 
			
		||||
struct trapframe;
 | 
			
		||||
struct cpu_info;
 | 
			
		||||
 | 
			
		||||
void fpuinit(struct cpu_info *);
 | 
			
		||||
void fpudrop(void);
 | 
			
		||||
void fpusave(struct lwp *);
 | 
			
		||||
void fpudiscard(struct lwp *);
 | 
			
		||||
void fputrap(struct trapframe *);
 | 
			
		||||
void fpusave_lwp(struct lwp *, int);
 | 
			
		||||
void fpusave_cpu(struct cpu_info *, int);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _AMD64_FPU_H_ */
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue
	
	Block a user