ReactOS 0.4.17-dev-1190-g4c812f4
notify.h File Reference
#include <uacpi/internal/types.h>
#include <uacpi/notify.h>
Include dependency graph for notify.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uacpi_status uacpi_initialize_notify (void)
 
void uacpi_deinitialize_notify (void)
 
uacpi_status uacpi_notify_all (uacpi_namespace_node *node, uacpi_u64 value)
 

Function Documentation

◆ uacpi_deinitialize_notify()

void uacpi_deinitialize_notify ( void  )

Definition at line 24 of file notify.c.

25{
28
30}
static void uacpi_free_native_mutex(uacpi_handle mtx)
Definition: mutex.h:27
#define UACPI_NULL
Definition: types.h:33
static uacpi_handle notify_mutex
Definition: notify.c:13

Referenced by uacpi_state_reset().

◆ uacpi_initialize_notify()

uacpi_status uacpi_initialize_notify ( void  )

Definition at line 15 of file notify.c.

16{
20
21 return UACPI_STATUS_OK;
22}
static uacpi_handle uacpi_create_native_mutex(void)
Definition: mutex.h:22
#define uacpi_unlikely(expr)
Definition: compiler.h:88
@ UACPI_STATUS_OUT_OF_MEMORY
Definition: status.h:13
@ UACPI_STATUS_OK
Definition: status.h:11

Referenced by uacpi_initialize().

◆ uacpi_notify_all()

uacpi_status uacpi_notify_all ( uacpi_namespace_node *  node,
uacpi_u64  value 
)

Definition at line 96 of file notify.c.

97{
99 struct notification_ctx *ctx;
101
105 );
108
111 return ret;
112
114 g_uacpi_rt_ctx.root_object->handlers->notify_head == UACPI_NULL) {
116 goto error_out;
117 }
118
119 ctx = uacpi_kernel_alloc(sizeof(*ctx));
120 if (uacpi_unlikely(ctx == UACPI_NULL)) {
122 goto error_out;
123 }
124
125 ctx->work_item = uacpi_kernel_create_work_item();
126 if (uacpi_unlikely(ctx->work_item == UACPI_NULL)) {
127 uacpi_free(ctx, sizeof(*ctx));
129 goto error_out;
130 }
131
132 ctx->node = node;
133 // In case this node goes out of scope
135
136 ctx->value = value;
138 uacpi_object_ref(ctx->node_object);
139
140 /*
141 * Nothing prevents the kernel from executing the work synchronously, e.g.
142 * because it sees no reason to defer it if it's not in an interrupt
143 * context. The handlers are free to call back into uACPI, be it to
144 * evaluate an object or to install another handler, so make sure that
145 * we're not holding onto anything that they might need. This includes the
146 * namespace, which is locked by whoever is sending the notification.
147 *
148 * Everything that the work needs is referenced by now, and there's nothing
149 * left for us to do after it's scheduled.
150 */
153
156 );
157
159 return UACPI_STATUS_OK;
160
161error_out:
163 return ret;
164}
static uacpi_status uacpi_release_native_mutex(uacpi_handle mtx)
Definition: mutex.h:44
static uacpi_status uacpi_acquire_native_mutex(uacpi_handle mtx)
Definition: mutex.h:32
struct uacpi_runtime_context g_uacpi_rt_ctx
Definition: uacpi.c:18
uacpi_status uacpi_namespace_write_unlock(void)
Definition: namespace.c:51
uacpi_object * uacpi_namespace_node_get_object_typed(const uacpi_namespace_node *node, uacpi_object_type_bits type_mask)
Definition: namespace.c:661
uacpi_object * uacpi_namespace_node_get_object(const uacpi_namespace_node *node)
Definition: namespace.c:653
uacpi_status uacpi_namespace_write_lock(void)
Definition: namespace.c:46
#define uacpi_free(mem, _)
Definition: stdlib.h:96
#define uacpi_unlikely_error(expr)
Definition: status.h:50
uacpi_status
Definition: status.h:10
@ UACPI_STATUS_INVALID_ARGUMENT
Definition: status.h:18
@ UACPI_STATUS_NO_HANDLER
Definition: status.h:25
void uacpi_object_ref(uacpi_object *obj)
Definition: types.c:733
@ UACPI_OBJECT_PROCESSOR_BIT
Definition: types.h:146
@ UACPI_OBJECT_THERMAL_ZONE_BIT
Definition: types.h:147
@ UACPI_OBJECT_DEVICE_BIT
Definition: types.h:140
return ret
Definition: mutex.c:147
static void do_notify(uacpi_handle opaque)
Definition: notify.c:69
void * uacpi_kernel_alloc(uacpi_size size)
Definition: uacpiosl.c:111
void uacpi_kernel_schedule_work(uacpi_work_type, uacpi_handle work_item, uacpi_work_handler handler, uacpi_handle ctx)
@ UACPI_WORK_NOTIFICATION
Definition: kernel_api.h:367
uacpi_handle uacpi_kernel_create_work_item(void)
static uacpi_u32 uacpi_shareable_ref(uacpi_handle handle)
Definition: shareable.h:40
uacpi_namespace_node * node
Definition: notify.c:33
uacpi_u64 value
Definition: notify.c:34
uacpi_object * node_object
Definition: notify.c:35
uacpi_device_notify_handler * notify_head
Definition: types.h:107
uacpi_handlers * handlers
Definition: types.h:277
Definition: dlist.c:348

Referenced by async_run_gpe_handler(), and handle_notify().