File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
extern crate alloc;
8
8
9
- use crate :: { Aml , AmlSink } ;
9
+ use crate :: { gas , Aml , AmlSink } ;
10
10
use alloc:: string:: String ;
11
11
use alloc:: { vec, vec:: Vec } ;
12
12
@@ -78,6 +78,7 @@ const ONESOP: u8 = 0xff;
78
78
// AML resouce data fields
79
79
const IOPORTDESC : u8 = 0x47 ;
80
80
const ENDTAG : u8 = 0x79 ;
81
+ const REGDESC : u8 = 0x82 ;
81
82
const MEMORY32FIXEDDESC : u8 = 0x86 ;
82
83
const DWORDADDRSPACEDESC : u8 = 0x87 ;
83
84
const WORDADDRSPACEDESC : u8 = 0x88 ;
@@ -772,6 +773,25 @@ impl Aml for Interrupt {
772
773
}
773
774
}
774
775
776
+ /// Register resource object
777
+ pub struct Register {
778
+ reg : gas:: GAS ,
779
+ }
780
+
781
+ impl Register {
782
+ pub fn new ( reg : gas:: GAS ) -> Self {
783
+ Self { reg }
784
+ }
785
+ }
786
+
787
+ impl Aml for Register {
788
+ fn to_aml_bytes ( & self , sink : & mut dyn AmlSink ) {
789
+ sink. byte ( REGDESC ) ; /* Register Descriptor */
790
+ sink. word ( 0x12 ) ; // length
791
+ self . reg . to_aml_bytes ( sink) ;
792
+ }
793
+ }
794
+
775
795
/// Device object with its device name and children objects in it.
776
796
pub struct Device < ' a > {
777
797
path : Path ,
You can’t perform that action at this time.
0 commit comments