ReactOS 0.4.17-dev-683-g0dafdc5
opregion.h File Reference
#include <uacpi/types.h>
#include <uacpi/status.h>
Include dependency graph for opregion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uacpi_status uacpi_install_address_space_handler (uacpi_namespace_node *device_node, enum uacpi_address_space space, uacpi_region_handler handler, uacpi_handle handler_context)
 
uacpi_status uacpi_uninstall_address_space_handler (uacpi_namespace_node *device_node, enum uacpi_address_space space)
 
uacpi_status uacpi_reg_all_opregions (uacpi_namespace_node *device_node, enum uacpi_address_space space)
 

Function Documentation

◆ uacpi_install_address_space_handler()

uacpi_status uacpi_install_address_space_handler ( uacpi_namespace_node device_node,
enum uacpi_address_space  space,
uacpi_region_handler  handler,
uacpi_handle  handler_context 
)

Install an address space handler to a device node. The handler is recursively connected to all of the operation regions of type 'space' underneath 'device_node'. Note that this recursion stops as soon as another device node that already has an address space handler of this type installed is encountered.

Definition at line 706 of file opregion.c.

710{
712 device_node, space, handler, handler_context, 0
713 );
714}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
uacpi_status uacpi_install_address_space_handler_with_flags(uacpi_namespace_node *device_node, enum uacpi_address_space space, uacpi_region_handler handler, uacpi_handle handler_context, uacpi_u16 flags)
Definition: opregion.c:625

◆ uacpi_reg_all_opregions()

uacpi_status uacpi_reg_all_opregions ( uacpi_namespace_node device_node,
enum uacpi_address_space  space 
)

Execute _REG(space, ACPI_REG_CONNECT) for all of the opregions with this address space underneath this device. This should only be called manually if you want to register an early handler that must be available before the call to uacpi_namespace_initialize().

Definition at line 590 of file opregion.c.

594{
596
598
600 return UACPI_STATUS_OK;
601
604 return ret;
605
609 return ret;
610 }
611
612 if (uacpi_unlikely(extract_handlers(device_node) == UACPI_NULL)) {
614 goto out;
615 }
616
618
619out:
622 return ret;
623}
#define ACPI_REG_CONNECT
Definition: actypes.h:890
uacpi_status uacpi_recursive_lock_acquire(struct uacpi_recursive_lock *lock)
Definition: mutex.c:288
uacpi_status uacpi_recursive_lock_release(struct uacpi_recursive_lock *lock)
Definition: mutex.c:308
#define UACPI_ENSURE_INIT_LEVEL_AT_LEAST(lvl)
Definition: context.h:127
uacpi_status uacpi_namespace_write_unlock(void)
Definition: namespace.c:51
uacpi_status uacpi_namespace_write_lock(void)
Definition: namespace.c:46
#define uacpi_unlikely(expr)
Definition: compiler.h:88
#define UACPI_NULL
Definition: types.h:33
#define uacpi_unlikely_error(expr)
Definition: status.h:49
uacpi_status
Definition: status.h:10
@ UACPI_STATUS_INVALID_ARGUMENT
Definition: status.h:18
@ UACPI_STATUS_OK
Definition: status.h:11
@ UACPI_INIT_LEVEL_NAMESPACE_LOADED
Definition: types.h:78
return ret
Definition: mutex.c:147
static uacpi_status reg_or_unreg_all_opregions(uacpi_namespace_node *device_node, enum uacpi_address_space space, uacpi_u8 connection_code)
Definition: opregion.c:525
static uacpi_bool space_needs_reg(enum uacpi_address_space space)
Definition: opregion.c:112
static uacpi_address_space_handlers * extract_handlers(uacpi_namespace_node *node)
Definition: opregion.c:570
struct uacpi_recursive_lock g_opregion_lock
Definition: opregion.c:13
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

Referenced by uacpi_namespace_initialize().

◆ uacpi_uninstall_address_space_handler()

uacpi_status uacpi_uninstall_address_space_handler ( uacpi_namespace_node device_node,
enum uacpi_address_space  space 
)

Uninstall the handler of type 'space' from a given device node.

Definition at line 716 of file opregion.c.

720{
724 struct opregion_iter_ctx iter_ctx;
725
728 return ret;
729
733 return ret;
734 }
735
736 handlers = extract_handlers(device_node);
739 goto out;
740 }
741
745 goto out;
746 }
747
748 iter_ctx.handler = handler;
749 iter_ctx.action = OPREGION_ITER_ACTION_UNINSTALL;
750
754 UACPI_PERMANENT_ONLY_NO, &iter_ctx
755 );
756
757 prev_handler = handlers->head;
758
759 // Are we the last linked handler?
760 if (prev_handler == handler) {
761 handlers->head = handler->next;
762 goto out_unreg;
763 }
764
765 // Nope, we're somewhere in the middle. Do a search.
766 while (prev_handler) {
767 if (prev_handler->next == handler) {
768 prev_handler->next = handler->next;
769 goto out;
770 }
771
772 prev_handler = prev_handler->next;
773 }
774
775out_unreg:
778
779out:
780 if (handler != UACPI_NULL)
782
785 return ret;
786}
#define ACPI_REG_DISCONNECT
Definition: actypes.h:889
uacpi_status uacpi_namespace_do_for_each_child(uacpi_namespace_node *parent, uacpi_iteration_callback descending_callback, uacpi_iteration_callback ascending_callback, uacpi_object_type_bits, uacpi_u32 max_depth, enum uacpi_should_lock, enum uacpi_permanent_only, void *user)
Definition: namespace.c:834
@ UACPI_PERMANENT_ONLY_NO
Definition: namespace.h:89
@ UACPI_SHOULD_LOCK_NO
Definition: namespace.h:94
void uacpi_address_space_handler_unref(uacpi_address_space_handler *handler)
Definition: types.c:551
#define UACPI_MAX_DEPTH_ANY
Definition: namespace.h:102
@ UACPI_STATUS_NO_HANDLER
Definition: status.h:25
@ UACPI_OBJECT_ANY_BIT
Definition: types.h:152
static xmlCharEncodingHandlerPtr * handlers
Definition: encoding.c:1380
static uacpi_address_space_handler * find_handler(uacpi_address_space_handlers *handlers, enum uacpi_address_space space)
Definition: opregion.c:193
static uacpi_iteration_decision do_install_or_uninstall_handler(uacpi_handle opaque, uacpi_namespace_node *node, uacpi_u32 depth)
Definition: opregion.c:430
@ OPREGION_ITER_ACTION_UNINSTALL
Definition: opregion.c:421