acpi: add aml_operation_region() term
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
		
							parent
							
								
									19fff2d405
								
							
						
					
					
						commit
						31127938f4
					
				@ -554,3 +554,17 @@ Aml *aml_package(uint8_t num_elements)
 | 
				
			|||||||
    build_append_byte(var->buf, num_elements);
 | 
					    build_append_byte(var->buf, num_elements);
 | 
				
			||||||
    return var;
 | 
					    return var;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefOpRegion */
 | 
				
			||||||
 | 
					Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
 | 
				
			||||||
 | 
					                          uint32_t offset, uint32_t len)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    Aml *var = aml_alloc();
 | 
				
			||||||
 | 
					    build_append_byte(var->buf, 0x5B); /* ExtOpPrefix */
 | 
				
			||||||
 | 
					    build_append_byte(var->buf, 0x80); /* OpRegionOp */
 | 
				
			||||||
 | 
					    build_append_namestring(var->buf, "%s", name);
 | 
				
			||||||
 | 
					    build_append_byte(var->buf, rs);
 | 
				
			||||||
 | 
					    build_append_int(var->buf, offset);
 | 
				
			||||||
 | 
					    build_append_int(var->buf, len);
 | 
				
			||||||
 | 
					    return var;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -28,6 +28,11 @@ typedef enum {
 | 
				
			|||||||
    aml_decode16 = 1,
 | 
					    aml_decode16 = 1,
 | 
				
			||||||
} AmlIODecode;
 | 
					} AmlIODecode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef enum {
 | 
				
			||||||
 | 
					    aml_system_memory = 0x00,
 | 
				
			||||||
 | 
					    aml_system_io = 0x01,
 | 
				
			||||||
 | 
					} AmlRegionSpace;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * init_aml_allocator:
 | 
					 * init_aml_allocator:
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@ -79,6 +84,8 @@ Aml *aml_call3(const char *method, Aml *arg1, Aml *arg2, Aml *arg3);
 | 
				
			|||||||
Aml *aml_call4(const char *method, Aml *arg1, Aml *arg2, Aml *arg3, Aml *arg4);
 | 
					Aml *aml_call4(const char *method, Aml *arg1, Aml *arg2, Aml *arg3, Aml *arg4);
 | 
				
			||||||
Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
 | 
					Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
 | 
				
			||||||
            uint8_t aln, uint8_t len);
 | 
					            uint8_t aln, uint8_t len);
 | 
				
			||||||
 | 
					Aml *aml_operation_region(const char *name, AmlRegionSpace rs,
 | 
				
			||||||
 | 
					                          uint32_t offset, uint32_t len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Block AML object primitives */
 | 
					/* Block AML object primitives */
 | 
				
			||||||
Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
 | 
					Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user