CPU
Defined in: src/drivers/base/cpu.ts:11
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CPU(
num):CPU
Defined in: src/drivers/base/cpu.ts:14
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”CPU
Overrides
Section titled “Overrides”Properties
Section titled “Properties”attrs:
Record<string,DeviceAttribute> ={}
Defined in: src/device.ts:151
Inherited from
Section titled “Inherited from”
optionalbus?:BusType<Device<unknown>,DeviceDriver<Device<unknown>>>
Defined in: src/device.ts:128
Inherited from
Section titled “Inherited from”class?
Section titled “class?”
optionalclass?:Class
Defined in: src/device.ts:131
Inherited from
Section titled “Inherited from”dev_t?
Section titled “dev_t?”
optionaldev_t?:DevT
Defined in: src/device.ts:134
The device number. Devices with one get a dev attribute and a link in /sys/dev.
Inherited from
Section titled “Inherited from”driver?
Section titled “driver?”
optionaldriver?:DeviceDriver<Device<unknown>>
Defined in: src/device.ts:129
Inherited from
Section titled “Inherited from”driver_data?
Section titled “driver_data?”
optionaldriver_data?:unknown
Defined in: src/device.ts:140
Whatever the bound driver wants to keep with the device, i.e. dev->driver_data
Inherited from
Section titled “Inherited from”
optionalid?:number
Defined in: src/device.ts:126
Inherited from
Section titled “Inherited from”kobj_parent?
Section titled “kobj_parent?”
optionalkobj_parent?:KObject
Defined in: src/device.ts:146
Forces where the device goes in sysfs, like setting dev->kobj.parent before register.
This is how a bus’ root device ends up somewhere like /sys/devices/system.
Inherited from
Section titled “Inherited from”kobject?
Section titled “kobject?”
optionalkobject?:DeviceKObject
Defined in: src/device.ts:149
/sys/devices/.../<name>. Only set while the device is registered.
Inherited from
Section titled “Inherited from”name:
string
Defined in: src/device.ts:122
Inherited from
Section titled “Inherited from”node_id
Section titled “node_id”node_id:
number=0
Defined in: src/drivers/base/cpu.ts:12
of_node?
Section titled “of_node?”
optionalof_node?:object&object
Defined in: src/device.ts:137
The device tree node this device was created from, i.e. dev->of_node
Type Declaration
Section titled “Type Declaration”
optionalid?:string
What the device is called under /sys/devices/platform. One is made up when there isn’t one.
kind:
"xterm"
Type Declaration
Section titled “Type Declaration”options?
Section titled “options?”
optionaloptions?:AttachXTermOptions
terminal
Section titled “terminal”terminal:
XTermLike
Inherited from
Section titled “Inherited from”parent?
Section titled “parent?”
optionalparent?:Device<unknown> |null
Defined in: src/device.ts:124
Inherited from
Section titled “Inherited from”power:
Partial<DevicePowerInfo> ={}
Defined in: src/device.ts:153
Inherited from
Section titled “Inherited from”removable?
Section titled “removable?”
optionalremovable?:"unknown"|"removable"|"fixed"
Defined in: src/device.ts:155
Inherited from
Section titled “Inherited from”
optionaltype?:DeviceType
Defined in: src/device.ts:130
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get path():
string|undefined
Defined in: src/device.ts:171
The device’s path relative to the root of sysfs, if it is registered
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”registered
Section titled “registered”Get Signature
Section titled “Get Signature”get registered():
boolean
Defined in: src/device.ts:166
Whether the device is currently in sysfs
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”attach()
Section titled “attach()”attach():
boolean
Defined in: src/device.ts:212
Look for a driver on the device’s bus that can handle it.
Returns
Section titled “Returns”boolean
whether the device ended up bound
Inherited from
Section titled “Inherited from”bind_driver()
Section titled “bind_driver()”bind_driver(
drv):void
Defined in: src/device.ts:255
Bind a device to a driver without probing it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Throws
Section titled “Throws”EBUSY if the device is already bound
Inherited from
Section titled “Inherited from”dev_node()
Section titled “dev_node()”dev_node():
object
Defined in: src/device.ts:356
Internal
Work out the name and mode a device’s node under /dev should have.
Returns
Section titled “Returns”object
a mode of 0 when nothing set one
mode:
number
name:
string
Inherited from
Section titled “Inherited from”link_driver()
Section titled “link_driver()”
protectedlink_driver():void
Defined in: src/device.ts:197
Link the device up with the driver it just bound to.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”register()
Section titled “register()”register():
void
Defined in: src/device.ts:284
Add a device to sysfs, link it up with its bus and class, then try to find it a driver.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”EEXIST if the device is already registered, or something else has its name
Inherited from
Section titled “Inherited from”register_under_node()
Section titled “register_under_node()”register_under_node(
node_id):void
Defined in: src/drivers/base/cpu.ts:23
Cross-link a CPU and the node it belongs to. Does nothing if either one isn’t registered yet.
Parameters
Section titled “Parameters”node_id
Section titled “node_id”number
Returns
Section titled “Returns”void
release_driver()
Section titled “release_driver()”release_driver():
void
Defined in: src/device.ts:265
Unbind a device from its driver. Does nothing if it isn’t bound.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”sysfs_parent()
Section titled “sysfs_parent()”
protectedsysfs_parent():KObject
Defined in: src/device.ts:178
Work out where a device goes in sysfs.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”try_bind()
Section titled “try_bind()”try_bind(
drv):boolean
Defined in: src/device.ts:234
Offer the device to a driver, binding the two if the driver’s probe accepts it.
A driver without a probe takes every device the bus matched for it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
whether the device was bound
Inherited from
Section titled “Inherited from”unregister()
Section titled “unregister()”unregister():
void
Defined in: src/device.ts:327
Remove a device from sysfs, unbinding it from its driver first. Does nothing if the device isn’t registered.
Returns
Section titled “Returns”void