Skip to content

Conversation

@lneto
Copy link
Contributor

@lneto lneto commented Dec 21, 2025

@@ -0,0 +1,75 @@
--
-- SPDX-FileCopyrightText: (c) 2024 Mohammad Shehar Yaar Tausif <sheharyaar48@gmail.com>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qrsikno2 we should have your copyright here

-- all = false -- This is the default
-- For more LDoc options, see: https://github.com/lunarmodules/LDoc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

Comment on lines +65 to +88
#define lunatik_runbh(runtime, handler, ret, ...) \
do { \
local_bh_disable(); \
lunatik_lock(runtime); \
if (unlikely(!lunatik_getstate(runtime))) \
ret = -ENXIO; \
else \
lunatik_handle(runtime, handler, ret, ## __VA_ARGS__); \
lunatik_unlock(runtime); \
local_bh_enable(); \
} while(0)

#define lunatik_runirq(runtime, handler, ret, ...) \
do { \
unsigned long flags; \
local_irq_save(flags); \
lunatik_lock(runtime); \
if (unlikely(!lunatik_getstate(runtime))) \
ret = -ENXIO; \
else \
lunatik_handle(runtime, handler, ret, ## __VA_ARGS__); \
lunatik_unlock(runtime); \
local_irq_restore(flags); \
} while(0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the lunatik_runirq is called in this line.
But the lunatik_runbh doesn't appear..do i need to remove it or both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two options.. keep them but calling lunatik_run inside, e.g.,

Suggested change
#define lunatik_runbh(runtime, handler, ret, ...) \
do { \
local_bh_disable(); \
lunatik_lock(runtime); \
if (unlikely(!lunatik_getstate(runtime))) \
ret = -ENXIO; \
else \
lunatik_handle(runtime, handler, ret, ## __VA_ARGS__); \
lunatik_unlock(runtime); \
local_bh_enable(); \
} while(0)
#define lunatik_runirq(runtime, handler, ret, ...) \
do { \
unsigned long flags; \
local_irq_save(flags); \
lunatik_lock(runtime); \
if (unlikely(!lunatik_getstate(runtime))) \
ret = -ENXIO; \
else \
lunatik_handle(runtime, handler, ret, ## __VA_ARGS__); \
lunatik_unlock(runtime); \
local_irq_restore(flags); \
} while(0)
#define lunatik_runbh(runtime, handler, ret, ...) \
do { \
local_bh_disable(); \
lunatik_run(runtime, handler, ret, ## __VA_ARGS__); \
local_bh_enable(); \
} while(0)
#define lunatik_runirq(runtime, handler, ret, ...) \
do { \
unsigned long flags; \
local_irq_save(flags); \
lunatik_run(runtime, handler, ret, ## __VA_ARGS__); \
local_irq_restore(flags); \
} while(0)

and applying to the other modules as luanetfilter and luaxdp, or removing them completely and calling local_bh_disable and local_irq_save explicitly..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think will split this in a separate commit..

lib/luahid.c Outdated
Comment on lines 170 to 171
typedef struct {
const struct hid_device_id *id;
} luahid_probe_arg_t;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need such structure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because we need a fixed type pattern of defination like luahid_xxx_arg_t for marco LUAHID_CALLBACK in this line. It needs to be defined for each callback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, we can just use a typedef, we don't need a nested struct.. I made the change.. can you check if it's working properly?

lib/luahid.c Outdated
Comment on lines 18 to 19
#include <lunatik.h>
#include <lauxlib.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <lunatik.h>
#include <lauxlib.h>
#include <lunatik.h>

* port hid-xiaomi to examples
* add gesture detection for qemu mouse
Comment on lines +6 to +7
-- Drvier for Qemu's USB mouse with gesture(dragging),
-- swipeing up to lock the mouse and swipeing down to unlock it.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add an entry on README for both examples, explaining how to run them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants