device

package
v1.7.0-dev-20191021 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2019 License: Apache-2.0 Imports: 4 Imported by: 306

Documentation

Overview

Package device contains code for describing both the software and hardware of computing devices.

Index

Constants

View Source
const (
	UnknownArchitecture = Architecture_UnknownArchitecture
	ARMv7a              = Architecture_ARMv7a
	ARMv8a              = Architecture_ARMv8a
	X86                 = Architecture_X86
	X86_64              = Architecture_X86_64
	MIPS                = Architecture_MIPS
	MIPS64              = Architecture_MIPS64
)
View Source
const (
	UnknownEndian = Endian_UnknownEndian
	BigEndian     = Endian_BigEndian
	LittleEndian  = Endian_LittleEndian
)
View Source
const (
	UnknownOS = OSKind_UnknownOS
	Windows   = OSKind_Windows
	OSX       = OSKind_OSX
	Linux     = OSKind_Linux
	Android   = OSKind_Android
	Stadia    = OSKind_Stadia
)
View Source
const AndroidMinimalSupportedAPIVersion = 23

Variables

View Source
var (
	UnknownABI = abi("unknown", UnknownOS, UnknownArchitecture, &MemoryLayout{})
	// Keep this one in, some applications incorrectly advertise arm, when they mean armv7
	AndroidARM      = abi("armeabi", Android, ARMv7a, ARMv7aLayout)
	AndroidARMv7a   = abi("armeabi-v7a", Android, ARMv7a, ARMv7aLayout)
	AndroidARM64v8a = abi("arm64-v8a", Android, ARMv8a, ARM64v8aLayout)
	AndroidX86      = abi("x86", Android, X86, X86IA32Layout)
	AndroidX86_64   = abi("x86-64", Android, X86_64, X86_64Layout)
	AndroidMIPS     = abi("mips", Android, MIPS, Little32)
	AndroidMIPS64   = abi("mips64", Android, MIPS64, Little64)

	LinuxX86_64   = abi("linux_x64", Linux, X86_64, Little64)
	OSXX86_64     = abi("osx_x64", OSX, X86_64, Little64)
	WindowsX86_64 = abi("windows_x64", Windows, X86_64, Little64)
	StadiaX86_64  = abi("stadia", Stadia, X86_64, Little64)
)
View Source
var (
	UnknownCPU = cpu("unknown", UnknownArchitecture)
	// Arm
	CortexA53 = cpu("Cortex A53", ARMv8a)
	CortexA57 = cpu("Cortex A57", ARMv8a)
	// Qualcomm
	Scorpion = cpu("Scorpion", ARMv7a)
	Krait    = cpu("Krait", ARMv7a)
	Kryo     = cpu("Kryo", ARMv8a)
	// Nvidia
	Denver = cpu("Denver", ARMv8a)
)
View Source
var (
	// ARMv7aLayout is the memory layout for the armv7a ABI.
	// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf
	// 4 DATA TYPES AND ALIGNMENT
	ARMv7aLayout = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 4, Alignment: 4},
		Integer: &DataTypeLayout{Size: 4, Alignment: 4},
		Size:    &DataTypeLayout{Size: 4, Alignment: 4},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}

	// ARM64v8aLayout is the memory layout for the arm64v8a ABI.
	// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf
	// 4 DATA TYPES AND ALIGNMENT
	ARM64v8aLayout = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 8, Alignment: 8},
		Integer: &DataTypeLayout{Size: 8, Alignment: 8},
		Size:    &DataTypeLayout{Size: 8, Alignment: 8},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}

	// X86IA32Layout is the memory layout for the x86 IA-32 ABI.
	X86IA32Layout = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 4, Alignment: 4},
		Integer: &DataTypeLayout{Size: 4, Alignment: 4},
		Size:    &DataTypeLayout{Size: 4, Alignment: 4},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 4},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 4},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}

	// X86_64Layout is the memory layout for the x86_64 ABI.
	X86_64Layout = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 8, Alignment: 8},
		Integer: &DataTypeLayout{Size: 4, Alignment: 4},
		Size:    &DataTypeLayout{Size: 8, Alignment: 8},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}

	Little32 = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 4, Alignment: 4},
		Integer: &DataTypeLayout{Size: 4, Alignment: 4},
		Size:    &DataTypeLayout{Size: 4, Alignment: 4},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}
	Little64 = &MemoryLayout{
		Endian:  LittleEndian,
		Pointer: &DataTypeLayout{Size: 8, Alignment: 8},
		Integer: &DataTypeLayout{Size: 8, Alignment: 8},
		Size:    &DataTypeLayout{Size: 8, Alignment: 8},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}
	Big32 = &MemoryLayout{
		Endian:  BigEndian,
		Pointer: &DataTypeLayout{Size: 4, Alignment: 4},
		Integer: &DataTypeLayout{Size: 4, Alignment: 4},
		Size:    &DataTypeLayout{Size: 4, Alignment: 4},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}
	Big64 = &MemoryLayout{
		Endian:  BigEndian,
		Pointer: &DataTypeLayout{Size: 8, Alignment: 8},
		Integer: &DataTypeLayout{Size: 8, Alignment: 8},
		Size:    &DataTypeLayout{Size: 8, Alignment: 8},
		Char:    &DataTypeLayout{Size: 1, Alignment: 1},
		I64:     &DataTypeLayout{Size: 8, Alignment: 8},
		I32:     &DataTypeLayout{Size: 4, Alignment: 4},
		I16:     &DataTypeLayout{Size: 2, Alignment: 2},
		I8:      &DataTypeLayout{Size: 1, Alignment: 1},
		F64:     &DataTypeLayout{Size: 8, Alignment: 8},
		F32:     &DataTypeLayout{Size: 4, Alignment: 4},
		F16:     &DataTypeLayout{Size: 2, Alignment: 2},
	}
)
View Source
var (
	UnknownGPU = gpu("unknown")

	Adreno320 = gpu("Adreno 320")
	Adreno330 = gpu("Adreno 330")
	Adreno418 = gpu("Adreno 418")
	Adreno420 = gpu("Adreno 420")
	Adreno430 = gpu("Adreno 430")
	Adreno530 = gpu("Adreno 530")
	Kepler    = gpu("Kepler")
)

Functions

func IsLinuxLike added in v1.6.0

func IsLinuxLike(k OSKind) bool

Types

type VersionMatch added in v1.2.0

type VersionMatch int

VersionMatch indicates how accuratly two OS versions match.

const (
	// NoMatch means the versions don't match at all.
	NoMatch VersionMatch = iota
	// MajorMatch means the versions only match up to the major version.
	MajorMatch
	// MajorAndMinorMatch means the versions only match up to the minor version.
	MajorAndMinorMatch
	// CompleteMatch means the versions matched completely.
	CompleteMatch
)

Directories

Path Synopsis
Package bind contains code for binding to and controlling devices.
Package bind contains code for binding to and controlling devices.
Package ggp contains code for binding to and controlling Stadia instances.
Package ggp contains code for binding to and controlling Stadia instances.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL