MCPcopy Create free account
hub / github.com/XpuOS/xsched / HwQueueLaunch

Function HwQueueLaunch

preempt/src/hal/hw_queue.cpp:71–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71EXPORT_C_FUNC XResult HwQueueLaunch(HwQueueHandle hwq, HwCommandHandle hw_cmd)
72{
73 std::shared_ptr<HwQueue> hwq_shptr = HwQueueManager::Get(hwq);
74 if (hwq_shptr == nullptr) {
75 XWARN("HwQueue with handle 0x" FMT_64X " does not exist", hwq);
76 return kXSchedErrorNotFound;
77 }
78 // Get and DELETE the HwCommand from the HwCommandManager.
79 std::shared_ptr<HwCommand> hw_cmd_shptr = HwCommandManager::Del(hw_cmd);
80 if (hw_cmd_shptr == nullptr) {
81 XWARN("HwCommand with handle 0x" FMT_64X " does not exist or not registered", hw_cmd);
82 return kXSchedErrorNotFound;
83 }
84
85 auto callback = std::dynamic_pointer_cast<HwCallbackCommand>(hw_cmd_shptr);
86 if (callback != nullptr) return callback->Launch(hwq);
87
88 hwq_shptr->Launch(hw_cmd_shptr);
89 return kXSchedSuccess;
90}
91
92EXPORT_C_FUNC XResult HwQueueSynchronize(HwQueueHandle hwq)
93{

Callers

nothing calls this directly

Calls 1

LaunchMethod · 0.45

Tested by

no test coverage detected