dde_linux: update usb_hid driver to Linux 6.1.20

The drivers uses the 'virt_linux' api and the current lx_kit
implementation. It is a drop-in replacement for the Linux 4.16.3 based
version.

issue #4958
This commit is contained in:
Sebastian Sumpf 2023-06-14 15:33:25 +02:00 committed by Christian Helmuth
parent e1b463082a
commit f668aea42a
26 changed files with 4923 additions and 0 deletions

View File

@ -0,0 +1,11 @@
MIRROR_FROM_REP_DIR := src/drivers/usb_hid
content: $(MIRROR_FROM_REP_DIR)
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
PORT_DIR := $(call port_dir,$(GENODE_DIR)/repos/dde_linux/ports/linux)
content: LICENSE
LICENSE:
cp $(PORT_DIR)/src/linux/COPYING $@

View File

@ -0,0 +1 @@
2023-07-04-e 3ad103c64cb765420638f0dccaed76d7b702b7e5

View File

@ -0,0 +1,8 @@
base
event_session
genode_c_api
jitterentropy
os
report_session
usb_session
virt_linux

View File

@ -0,0 +1,29 @@
USB HID driver
##############
Supports keyboard and mouse connected via USB. It connects to one or multiple
USB sessions and reports input events to an event session. A run script can be
found under 'run/usb_hid_raw.run'.
Configuration snippet:
!<start name="usb_hid_drv">
! <resource name="RAM" quantum="10M"/>
! <config use_report="yes"/>
!</start>
When the use_report attribute is set, the HID driver will request a ROM called
"report" that is used to iterate over all devices provided by the USB host
controller driver (resp. a rom filter). In that mode the driver tries to
claim all HID devices (class 0x3) via dedicated USB sessions.
Keyboard LED handling
~~~~~~~~~~~~~~~~~~~~~
The state of the keyboard LEDs like capslock can be controlled by providing
a corresponding ROM to the driver and configure it appropriately:
!...
!<config capslock_led="rom" numlock_led="rom" scrlock_led="rom"/>
!...

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,348 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <lx_emul.h>
#include <linux/interrupt.h>
DEFINE_STATIC_KEY_FALSE(force_irqthreads_key);
#ifdef __arm__
#include <asm/uaccess.h>
unsigned long arm_copy_to_user(void *to, const void *from, unsigned long n)
{
lx_emul_trace_and_stop(__func__);
}
asmlinkage void __div0(void);
asmlinkage void __div0(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/dma-map-ops.h>
void arch_teardown_dma_ops(struct device * dev)
{
lx_emul_trace(__func__);
}
extern void arm_heavy_mb(void);
void arm_heavy_mb(void)
{
// FIXME: on Cortex A9 we potentially need to flush L2-cache
lx_emul_trace(__func__);
}
#else
#include <linux/context_tracking_irq.h>
noinstr void ct_irq_enter(void)
{
lx_emul_trace(__func__);
}
#include <linux/context_tracking_irq.h>
noinstr void ct_irq_exit(void)
{
lx_emul_trace(__func__);
}
#include <linux/timekeeper_internal.h>
void update_vsyscall(struct timekeeper * tk)
{
lx_emul_trace(__func__);
}
#endif
unsigned long __must_check __arch_copy_to_user(void __user *to, const void *from, unsigned long n);
unsigned long __must_check __arch_copy_to_user(void __user *to, const void *from, unsigned long n)
{
lx_emul_trace_and_stop(__func__);
}
#include <net/net_namespace.h>
void net_ns_init(void)
{
lx_emul_trace(__func__);
}
#include <linux/kobject.h>
int kobject_uevent(struct kobject * kobj,enum kobject_action action)
{
lx_emul_trace(__func__);
return 0;
}
#include <linux/fs.h>
int register_chrdev_region(dev_t from,unsigned count,const char * name)
{
lx_emul_trace(__func__);
return 0;
}
#include <linux/syscore_ops.h>
void register_syscore_ops(struct syscore_ops * ops)
{
lx_emul_trace(__func__);
}
#include <linux/usb/hcd.h>
void __init usb_init_pool_max(void)
{
lx_emul_trace(__func__);
}
#include <linux/usb/hcd.h>
void usb_hcd_synchronize_unlinks(struct usb_device * udev)
{
lx_emul_trace(__func__);
}
#include <linux/refcount.h>
void refcount_warn_saturate(refcount_t * r,enum refcount_saturation_type t)
{
lx_emul_trace(__func__);
}
#include <linux/semaphore.h>
int __sched down_interruptible(struct semaphore * sem)
{
lx_emul_trace(__func__);
return 0;
}
extern int usb_major_init(void);
int usb_major_init(void)
{
lx_emul_trace(__func__);
return 0;
}
extern int __init usb_devio_init(void);
int __init usb_devio_init(void)
{
lx_emul_trace(__func__);
return 0;
}
#include <linux/usb.h>
int usb_string(struct usb_device * dev,int index,char * buf,size_t size)
{
lx_emul_trace(__func__);
return 0;
}
extern char * usb_cache_string(struct usb_device * udev,int index);
char * usb_cache_string(struct usb_device * udev,int index)
{
lx_emul_trace(__func__);
return NULL;
}
void usb_kill_urb(struct urb * urb)
{
lx_emul_trace(__func__);
}
#include <linux/usb/hcd.h>
struct usb_hcd * usb_get_hcd(struct usb_hcd * hcd)
{
lx_emul_trace(__func__);
return hcd;
}
#include <linux/usb/hcd.h>
void usb_put_hcd(struct usb_hcd * hcd)
{
lx_emul_trace(__func__);
}
#include <linux/kernel.h>
bool parse_option_str(const char * str,const char * option)
{
lx_emul_trace(__func__);
return false;
}
#include <linux/semaphore.h>
void __sched up(struct semaphore * sem)
{
lx_emul_trace(__func__);
}
#include <linux/semaphore.h>
void __sched down(struct semaphore * sem)
{
lx_emul_trace(__func__);
}
#include <linux/semaphore.h>
int __sched down_trylock(struct semaphore * sem)
{
lx_emul_trace(__func__);
return 0;
}
#include <linux/rcupdate.h>
void synchronize_rcu(void)
{
lx_emul_trace(__func__);
}
#include <linux/input.h>
void input_ff_destroy(struct input_dev * dev)
{
lx_emul_trace(__func__);
}
#include <linux/input/mt.h>
void input_mt_destroy_slots(struct input_dev * dev)
{
lx_emul_trace(__func__);
}
#include <linux/skbuff.h>
void skb_init()
{
lx_emul_trace(__func__);
}
extern void software_node_notify(struct device * dev);
void software_node_notify(struct device * dev)
{
lx_emul_trace(__func__);
}
extern void software_node_notify_remove(struct device * dev);
void software_node_notify_remove(struct device * dev)
{
lx_emul_trace(__func__);
}
extern int usb_create_sysfs_dev_files(struct usb_device * udev);
int usb_create_sysfs_dev_files(struct usb_device * udev)
{
lx_emul_trace(__func__);
return 0;
}
extern void usb_remove_sysfs_dev_files(struct usb_device * udev);
void usb_remove_sysfs_dev_files(struct usb_device * udev)
{
lx_emul_trace(__func__);
}
extern int usb_create_ep_devs(struct device * parent,struct usb_host_endpoint * endpoint,struct usb_device * udev);
int usb_create_ep_devs(struct device * parent,struct usb_host_endpoint * endpoint,struct usb_device * udev)
{
lx_emul_trace(__func__);
return 0;
}
extern void usb_remove_ep_devs(struct usb_host_endpoint * endpoint);
void usb_remove_ep_devs(struct usb_host_endpoint * endpoint)
{
lx_emul_trace(__func__);
}
extern void usb_notify_add_device(struct usb_device * udev);
void usb_notify_add_device(struct usb_device * udev)
{
lx_emul_trace(__func__);
}
extern void usb_notify_remove_device(struct usb_device * udev);
void usb_notify_remove_device(struct usb_device * udev)
{
lx_emul_trace(__func__);
}
extern void usb_create_sysfs_intf_files(struct usb_interface * intf);
void usb_create_sysfs_intf_files(struct usb_interface * intf)
{
lx_emul_trace(__func__);
}
extern void usb_remove_sysfs_intf_files(struct usb_interface * intf);
void usb_remove_sysfs_intf_files(struct usb_interface * intf)
{
lx_emul_trace(__func__);
}
extern void usb_disable_interface(struct usb_device * dev,struct usb_interface * intf,bool reset_hardware);
void usb_disable_interface(struct usb_device * dev,struct usb_interface * intf,bool reset_hardware)
{
lx_emul_trace(__func__);
}

View File

@ -0,0 +1,206 @@
/*
* \brief Keyboard LED handling
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/usb.h>
struct keyboard
{
struct input_dev *input_dev;
struct usb_interface *intf;
struct usb_device *udev;
struct list_head list;
};
enum Update_state { NONE, UPDATE, BLOCKED };
struct led_update
{
enum Update_state state;
struct completion update;
unsigned leds;
};
static LIST_HEAD(_keyboards);
static struct led_update _led_update;
static bool keyboard_match(struct keyboard *kbd, struct input_dev *input_dev)
{
return kbd->input_dev == input_dev;
}
static void keyboard_update(struct keyboard *kbd, unsigned leds)
{
usb_control_msg(kbd->udev, usb_sndctrlpipe(kbd->udev, 0),
0x9, USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0x200,
kbd->intf->cur_altsetting->desc.bInterfaceNumber,
&leds, 1, 500);
}
void lx_led_state_update(bool capslock, bool numlock, bool scrlock)
{
struct keyboard *kbd;
unsigned leds = 0;
leds |= capslock ? 1u << LED_CAPSL : 0;
leds |= numlock ? 1u << LED_NUML : 0;
leds |= scrlock ? 1u << LED_SCROLLL : 0;
_led_update.leds = leds;
_led_update.state = UPDATE;
/* udpdate keyboards */
list_for_each_entry(kbd, &_keyboards, list) {
keyboard_update(kbd, leds);
}
if (_led_update.state == BLOCKED)
complete(&_led_update.update);
_led_update.state = NONE;
}
static void wait_for_update(void)
{
if (_led_update.state == UPDATE) {
_led_update.state = BLOCKED;
wait_for_completion(&_led_update.update);
}
}
static int led_connect(struct input_handler *handler, struct input_dev *dev,
const struct input_device_id *id)
{
struct keyboard *kbd;
struct input_handle *handle;
wait_for_update();
handle = (struct input_handle *)kzalloc(sizeof(*handle), 0);
if (!handle) return -ENOMEM;
handle->dev = input_get_device(dev);
handle->handler = handler;
kbd = (struct keyboard *)kzalloc(sizeof(*kbd), GFP_KERNEL);
if (!kbd) goto err;
kbd->input_dev = input_get_device(dev);
kbd->intf = container_of(kbd->input_dev->dev.parent->parent, struct usb_interface, dev);
kbd->udev = interface_to_usbdev(kbd->intf);
INIT_LIST_HEAD(&kbd->list);
list_add_tail(&kbd->list, &_keyboards);
keyboard_update(kbd, _led_update.leds);
input_register_handle(handle);
return 0;
err:
kfree(handle);
return -ENOMEM;
}
static void led_disconnect(struct input_handle *handle)
{
struct input_dev *dev = handle->dev;
struct keyboard *kbd, *temp;
wait_for_update();
list_for_each_entry_safe(kbd, temp, &_keyboards, list) {
if (keyboard_match(kbd, dev)) {
list_del(&kbd->list);
kfree(kbd);
}
}
input_unregister_handle(handle);
input_put_device(dev);
kfree(handle);
}
static bool led_match(struct input_handler *handler, struct input_dev *dev)
{
struct hid_device *hid = (struct hid_device *)input_get_drvdata(dev);
struct hid_report *report;
struct hid_usage *usage;
unsigned i, j;
/* search report for keyboard entries */
list_for_each_entry(report, &hid->report_enum[0].report_list, list) {
for (i = 0; i < report->maxfield; i++)
for (j = 0; j < report->field[i]->maxusage; j++) {
usage = report->field[i]->usage + j;
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_KEYBOARD) {
return true;
}
}
}
return false;
}
static struct input_device_id led_ids[] = {
{ .driver_info = 1 }, /* match all */
{ },
};
MODULE_DEVICE_TABLE(input, led_ids);
static struct input_handler led_handler = {
.name = "keyboard_led",
.connect = led_connect,
.disconnect = led_disconnect,
.id_table = led_ids,
.match = led_match,
.id_table = led_ids,
};
static int __init input_leds_init(void)
{
_led_update.state = NONE;
init_completion(&_led_update.update);
return input_register_handler(&led_handler);
}
static void __exit input_leds_exit(void)
{
input_unregister_handler(&led_handler);
}
/**
* Let's hook into the input_leds initcall, so we do not need to register
* an additional one
*/
module_init(input_leds_init);
module_exit(input_leds_exit);

View File

@ -0,0 +1,66 @@
/*
* \brief Configuration of keyboard mode indicators
* \author Norman Feske
* \date 2017-10-25
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _INPUT__LED_STATE_H_
#define _INPUT__LED_STATE_H_
#include <util/xml_node.h>
#include <util/reconstructible.h>
#include <base/component.h>
namespace Usb { struct Led_state; }
struct Usb::Led_state
{
Genode::Env &_env;
typedef Genode::String<32> Name;
Name const _name;
Genode::Constructible<Genode::Attached_rom_dataspace> _rom { };
bool _enabled = false;
Led_state(Genode::Env &env, Name const &name) : _env(env), _name(name) { }
void update(Genode::Xml_node config, Genode::Signal_context_capability sigh)
{
typedef Genode::String<32> Attr;
typedef Genode::String<16> Value;
Attr const attr(_name, "_led");
Value const value = config.attribute_value(attr.string(), Value());
bool const rom_configured = (value == "rom");
if (rom_configured && !_rom.constructed()) {
_rom.construct(_env, _name.string());
_rom->sigh(sigh);
}
if (!rom_configured && _rom.constructed())
_rom.destruct();
if (_rom.constructed())
_rom->update();
_enabled = _rom.constructed() ? _rom->xml().attribute_value("enabled", false)
: config.attribute_value(attr.string(), false);
}
bool enabled() const { return _enabled; }
};
#endif /* _INPUT__LED_STATE_H_ */

View File

@ -0,0 +1,35 @@
/*
* \brief Implementation of driver specific Linux functions
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <lx_emul.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/sysfs.h>
#include <linux/usb.h>
#include <usb_hid.h>
const struct attribute_group input_poller_attribute_group;
pteval_t __default_kernel_pte_mask __read_mostly = ~0;
struct device_type usb_if_device_type = {
.name = "usb_interface"
};
struct usb_driver usbfs_driver = {
.name = "usbfs"
};
const struct attribute_group *usb_device_groups[] = { };

View File

@ -0,0 +1,21 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Sebastian Sumpf
* \date 2023-07-11
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <lx_emul/debug.h>
#include <linux/init.h>
#include <linux/sched/debug.h>
#include <linux/usb.h>
struct input_dev_poller;
struct input_event;
struct usb_hub;

View File

@ -0,0 +1,46 @@
/*
* \brief Post kernel activity
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <linux/sched/task.h>
#include <usb_hid.h>
static struct task_struct *main_task = NULL;
struct task_struct *lx_user_new_usb_task(int (*func)(void*), void *args)
{
int pid = kernel_thread(func, args, CLONE_FS | CLONE_FILES);
return find_task_by_pid_ns(pid, NULL);
}
void lx_user_destroy_usb_task(struct task_struct *task)
{
if (task != current) {
printk("%s: task: %px is not current: %px\n", __func__,
task, current);
return;
}
/* unblock main task which initiated destruction */
lx_emul_task_unblock(main_task);
do_exit(0);
}
void lx_user_init(void)
{
int pid = kernel_thread(lx_user_main_task, &main_task, CLONE_FS | CLONE_FILES);
main_task = find_task_by_pid_ns(pid, NULL);
}

View File

@ -0,0 +1,371 @@
/*
* \brief C++ initialization, session, and client handling
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <base/attached_rom_dataspace.h>
#include <base/component.h>
#include <base/env.h>
#include <base/registry.h>
#include <lx_emul/init.h>
#include <lx_emul/task.h>
#include <lx_kit/env.h>
#include <genode_c_api/event.h>
/* C-interface */
#include <usb_hid.h>
#include <led_state.h>
using namespace Genode;
struct Task_handler
{
task_struct *task;
Signal_handler<Task_handler> handler;
bool handling_signal { false };
bool running { true };
/*
* If the task is currently executing and the signal handler
* is called again via 'block_and_schedule()', we need to
* keep this information, so the task does not block at the
* end when a new signal already occurred.
*
* Initialized as true for the initial run of the task.
*/
bool _signal_pending { true };
void handle_signal()
{
_signal_pending = true;
lx_emul_task_unblock(task);
handling_signal = true;
Lx_kit::env().scheduler.execute();
handling_signal = false;
}
bool signal_pending()
{
bool ret = _signal_pending;
_signal_pending = false;
return ret;
}
void block_and_schedule()
{
lx_emul_task_schedule(true);
}
void destroy_task()
{
running = false;
lx_emul_task_unblock(task);
/* will be unblocked by lx_user_destroy_usb_task */
lx_emul_task_schedule(true);
}
Task_handler(Entrypoint & ep, task_struct *task)
: task(task), handler(ep, *this, &Task_handler::handle_signal) { }
/* non-copyable */
Task_handler(const Task_handler&) = delete;
Task_handler & operator=(const Task_handler&) = delete;
};
struct Leds
{
Env &env;
Attached_rom_dataspace &config_rom;
task_struct *led_task { lx_user_new_usb_task(led_task_entry, this) };
Task_handler led_task_handler { env.ep(), led_task };
Usb::Led_state capslock { env, "capslock" },
numlock { env, "numlock" },
scrlock { env, "scrlock" };
Leds(Env &env, Attached_rom_dataspace &config_rom)
: env(env), config_rom(config_rom) { };
/* non-copyable */
Leds(const Leds&) = delete;
Leds & operator=(const Leds&) = delete;
void handle_config()
{
config_rom.update();
Genode::Xml_node config =config_rom.xml();
capslock.update(config, led_task_handler.handler);
numlock .update(config, led_task_handler.handler);
scrlock .update(config, led_task_handler.handler);
}
/**********
** Task **
**********/
static int led_task_entry(void *arg)
{
Leds &led = *reinterpret_cast<Leds *>(arg);
while (true) {
led.handle_config();
lx_led_state_update(led.capslock.enabled(),
led.numlock.enabled(),
led.scrlock.enabled());
led.led_task_handler.block_and_schedule();
}
}
};
struct Device : Registry<Device>::Element
{
using Label = String<64>;
Env &env;
Label label;
/*
* Dedicated allocator per device to notice dangling
* allocations on device destruction.
*/
Allocator_avl alloc { &Lx_kit::env().heap };
task_struct *state_task { lx_user_new_usb_task(state_task_entry, this) };
task_struct *urb_task { lx_user_new_usb_task(urb_task_entry, this) };
Task_handler state_task_handler { env.ep(), state_task };
Task_handler urb_task_handler { env.ep(), urb_task };
genode_usb_client_handle_t usb_handle {
genode_usb_client_create(genode_env_ptr(env),
genode_allocator_ptr(Lx_kit::env().heap),
genode_range_allocator_ptr(alloc),
label.string(),
genode_signal_handler_ptr(state_task_handler.handler)) };
bool updated { true };
bool registered { false };
void *lx_device_handle { nullptr };
Device(Env &env, Registry<Device> &registry, Label label)
:
Registry<Device>::Element(registry, *this),
env(env), label(label)
{
genode_usb_client_sigh_ack_avail(usb_handle,
genode_signal_handler_ptr(urb_task_handler.handler));
}
~Device()
{
genode_usb_client_destroy(usb_handle,
genode_allocator_ptr(Lx_kit::env().heap));
state_task_handler.destroy_task();
urb_task_handler.destroy_task();
}
/* non-copyable */
Device(const Device&) = delete;
Device & operator=(const Device&) = delete;
void register_device()
{
registered = true;
lx_device_handle = lx_emul_usb_client_register_device(usb_handle, label.string());
if (!lx_device_handle) registered = false;
}
void unregister_device()
{
lx_emul_usb_client_unregister_device(usb_handle, lx_device_handle);
registered = false;
}
bool deinit() { return !registered &&
!state_task_handler.handling_signal &&
!urb_task_handler.handling_signal; }
/**********
** Task **
**********/
static int state_task_entry(void *arg)
{
Device &device = *reinterpret_cast<Device *>(arg);
while (device.state_task_handler.running) {
while (device.state_task_handler.signal_pending()) {
if (genode_usb_client_plugged(device.usb_handle) && !device.registered)
device.register_device();
if (!genode_usb_client_plugged(device.usb_handle) && device.registered)
device.unregister_device();
}
device.state_task_handler.block_and_schedule();
}
lx_user_destroy_usb_task(device.state_task_handler.task);
return 0;
}
static int urb_task_entry(void *arg)
{
Device &device = *reinterpret_cast<Device *>(arg);
while (device.urb_task_handler.running) {
if (device.registered)
genode_usb_client_execute_completions(device.usb_handle);
device.urb_task_handler.block_and_schedule();
}
lx_user_destroy_usb_task(device.urb_task_handler.task);
return 0;
}
};
struct Driver
{
Env &env;
Task_handler task_handler;
Heap &heap { Lx_kit::env().heap };
bool use_report { false };
Constructible<Attached_rom_dataspace> report_rom { };
Attached_rom_dataspace config_rom { env, "config" };
Leds leds { env, config_rom };
Registry<Device> devices { };
Driver(Env &env, task_struct *task)
: env(env), task_handler(env.ep(), task)
{
try {
Xml_node config = config_rom.xml();
use_report = config.attribute_value("use_report", false);
} catch(...) { }
if (use_report)
warning("use compatibility mode: ",
"will claim all HID devices from USB report");
}
void scan_report()
{
if (!report_rom.constructed()) {
report_rom.construct(env, "report");
report_rom->sigh(task_handler.handler);
}
report_rom->update();
devices.for_each([&] (Device & d) { d.updated = false; });
try {
Xml_node report_node = report_rom->xml();
report_node.for_each_sub_node([&] (Xml_node & dev_node)
{
unsigned long c = 0;
dev_node.attribute("class").value(c);
if (c != 0x3 /* USB_CLASS_HID */) return;
Device::Label label;
dev_node.attribute("label").value(label);
bool found = false;
devices.for_each([&] (Device & d) {
if (d.label == label) d.updated = found = true; });
if (!found) new (heap) Device(env, devices, label);
});
} catch(...) {
error("Error parsing USB devices report");
throw;
};
devices.for_each([&] (Device & d) {
if (!d.updated && d.deinit()) {
destroy(heap, &d);
}
});
}
};
struct Main
{
Env &env;
Signal_handler<Main> signal_handler { env.ep(), *this, &Main::handle_signal };
Main(Env &env) : env(env) { }
void handle_signal()
{
Lx_kit::env().scheduler.execute();
}
};
void Component::construct(Env & env)
{
static Main main { env };
Lx_kit::initialize(env, main.signal_handler);
env.exec_static_constructors();
genode_event_init(genode_env_ptr(env),
genode_allocator_ptr(Lx_kit::env().heap));
lx_emul_start_kernel(nullptr);
}
/**********
** Task **
**********/
int lx_user_main_task(void *data)
{
task_struct *task = *static_cast<task_struct **>(data);
static Driver driver { Lx_kit::env().env, task };
for (;;) {
while (driver.task_handler.signal_pending()) {
if (!driver.use_report)
static Device dev(driver.env, driver.devices, Device::Label(""));
else
driver.scan_report();
}
driver.task_handler.block_and_schedule();
}
return 0;
}

View File

@ -0,0 +1,634 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit
* \date 2023-07-01
*/
#include <lx_emul.h>
#include <linux/ratelimit_types.h>
int ___ratelimit(struct ratelimit_state * rs,const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/clk-provider.h>
const char * __clk_get_name(const struct clk * clk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/cpumask.h>
struct cpumask __cpu_active_mask;
#include <linux/irqdomain.h>
struct irq_domain * __irq_domain_add(struct fwnode_handle * fwnode,unsigned int size,irq_hw_number_t hwirq_max,int direct_max,const struct irq_domain_ops * ops,void * host_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <asm-generic/percpu.h>
unsigned long __per_cpu_offset[NR_CPUS] = {};
#include <linux/printk.h>
int __printk_ratelimit(const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_enter(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_exit(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched/task.h>
void __put_task_struct(struct task_struct * tsk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
int _printk_deferred(const char * fmt,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/random.h>
void add_device_randomness(const void * buf,size_t len)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int add_uevent_var(struct kobj_uevent_env * env,const char * format,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
async_cookie_t async_schedule_node(async_func_t func,void * data,int node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
void async_synchronize_full(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
noinstr void ct_irq_enter(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
void ct_irq_enter_irqson(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
noinstr void ct_irq_exit(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
void ct_irq_exit_irqson(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/leds.h>
int devm_led_classdev_register_ext(struct device * parent,struct led_classdev * led_cdev,struct led_init_data * init_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
u64 div64_u64(u64 dividend,u64 divisor)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
u64 div64_u64_rem(u64 dividend,u64 divisor,u64 * remainder)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
s64 div_s64_rem(s64 dividend,s32 divisor,s32 * remainder)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/dma-map-ops.h>
bool dma_default_coherent;
#include <asm-generic/softirq_stack.h>
void do_softirq_own_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
asmlinkage __visible void dump_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/rcuwait.h>
void finish_rcuwait(struct rcuwait * w)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 guid_index[16] = {};
#include <linux/irq.h>
void handle_fasteoi_irq(struct irq_desc * desc)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/init.h>
bool initcall_debug;
extern void input_dev_poller_finalize(struct input_dev_poller * poller);
void input_dev_poller_finalize(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_start(struct input_dev_poller * poller);
void input_dev_poller_start(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_stop(struct input_dev_poller * poller);
void input_dev_poller_stop(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_create_memless(struct input_dev * dev,void * data,int (* play_effect)(struct input_dev *,void *,struct ff_effect *))
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_event(struct input_dev * dev,unsigned int type,unsigned int code,int value)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_mt_release_slots(struct input_dev * dev);
void input_mt_release_slots(struct input_dev * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void __sched io_schedule(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void io_schedule_finish(int token)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
int io_schedule_prepare(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
long __sched io_schedule_timeout(long timeout)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_can_set_affinity(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_domain_free_irqs_common(struct irq_domain * domain,unsigned int virq,unsigned int nr_irqs)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_domain_set_info(struct irq_domain * domain,unsigned int virq,irq_hw_number_t hwirq,const struct irq_chip * chip,void * chip_data,irq_flow_handler_t handler,void * handler_data,const char * handler_name)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq.h>
void irq_modify_status(unsigned int irq,unsigned long clr,unsigned long set)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_set_affinity(unsigned int irq,const struct cpumask * cpumask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_set_default_host(struct irq_domain * domain)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqnr.h>
struct irq_desc * irq_to_desc(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq_work.h>
void irq_work_tick(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/slab.h>
void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp_t flags)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_synth_uevent(struct kobject * kobj,const char * buf,size_t count)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * envp_ext[])
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/delay.h>
unsigned long lpj_fine;
#include <linux/of_device.h>
void of_device_uevent(struct device * dev,struct kobj_uevent_env * env)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
struct property * of_find_property(const struct device_node * np,const char * name,int * lenp)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
const struct fwnode_operations of_fwnode_ops;
#include <linux/of.h>
const char * of_prop_next_string(struct property * prop,const char * cur)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
int of_property_read_string(const struct device_node * np,const char * propname,const char ** out_string)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
void smp_call_function_many(const struct cpumask * mask,smp_call_func_t func,void * info,bool wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/jump_label.h>
bool static_key_initialized;
#include <linux/clockchips.h>
void tick_broadcast(const struct cpumask * mask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_add(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_del(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
struct timerqueue_node * timerqueue_iterate_next(struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_block_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_clear_halt(struct usb_device * dev,int pipe)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_devio_cleanup(void);
void usb_devio_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware);
void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_free_streams(struct usb_interface * interface,struct usb_host_endpoint ** eps,unsigned int num_eps,gfp_t mem_flags)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_get_device_descriptor(struct usb_device * dev,unsigned int size);
int usb_get_device_descriptor(struct usb_device * dev,unsigned int size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_get_status(struct usb_device * dev,int recip,int type,int target,void * data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_alloc_bandwidth(struct usb_device * udev,struct usb_host_config * new_config,struct usb_host_interface * cur_alt,struct usb_host_interface * new_alt)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_find_raw_port_number(struct usb_hcd * hcd,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_hub_create_port_device(struct usb_hub * hub,int port1);
int usb_hub_create_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_hub_remove_port_device(struct usb_hub * hub,int port1);
void usb_hub_remove_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_interrupt_msg(struct usb_device * usb_dev,unsigned int pipe,void * data,int len,int * actual_length,int timeout)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_major_cleanup(void);
void usb_major_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/of.h>
struct device_node * usb_of_get_device_node(struct usb_device * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_set_isoch_delay(struct usb_device * dev);
int usb_set_isoch_delay(struct usb_device * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/ch9.h>
const char * usb_speed_string(enum usb_device_speed speed)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_unlink_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_unpoison_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 uuid_index[16] = {};
#include <linux/sched/wake_q.h>
void wake_q_add_safe(struct wake_q_head * head,struct task_struct * task)
{
lx_emul_trace_and_stop(__func__);
}

View File

@ -0,0 +1,72 @@
arch/arm/lib/clearbit.S
arch/arm/lib/div64.S
arch/arm/lib/findbit.S
arch/arm/lib/setbit.S
arch/arm/lib/strchr.S
arch/arm/lib/testclearbit.S
arch/arm/lib/testsetbit.S
drivers/base/bus.c
drivers/base/core.c
drivers/base/class.c
drivers/base/devres.c
drivers/base/driver.c
drivers/base/dd.c
drivers/base/property.c
drivers/hid/hid-apple.c
drivers/hid/hid-cherry.c
drivers/hid/hid-core.c
drivers/hid/hid-generic.c
drivers/hid/hid-holtek-mouse.c
drivers/hid/hid-input.c
drivers/hid/hid-microsoft.c
drivers/hid/hid-quirks.c
drivers/hid/usbhid/hid-core.c
drivers/input/input.c
drivers/usb/core/config.c
drivers/usb/core/driver.c
drivers/usb/core/generic.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/core/usb.c
kernel/kthread.c
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/rwsem.c
kernel/notifier.c
kernel/sched/build_utility.c
kernel/smpboot.c
kernel/softirq.c
kernel/time/clockevents.c
kernel/time/clocksource.c
kernel/time/hrtimer.c
kernel/time/jiffies.c
kernel/time/ntp.c
kernel/time/tick-broadcast.c
kernel/time/tick-broadcast-hrtimer.c
kernel/time/tick-common.c
kernel/time/tick-oneshot.c
kernel/time/tick-sched.c
kernel/time/time.c
kernel/time/timeconv.c
kernel/time/timecounter.c
kernel/time/timekeeping.c
kernel/time/timer.c
kernel/time/timer_list.c
kernel/workqueue.c
mm/util.c
lib/bitmap.c
lib/ctype.c
lib/find_bit.c
lib/hexdump.c
lib/hweight.c
lib/idr.c
lib/kasprintf.c
lib/klist.c
lib/kobject.c
lib/kstrtox.c
lib/radix-tree.c
lib/xarray.c
lib/siphash.c
lib/string.c
lib/string_helpers.c
lib/vsprintf.c

View File

@ -0,0 +1,3 @@
REQUIRES := arm
include $(PRG_DIR)/../../target.inc

View File

@ -0,0 +1,599 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit
* \date 2023-06-28
*/
#include <lx_emul.h>
#include <linux/ratelimit_types.h>
int ___ratelimit(struct ratelimit_state * rs,const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/clk-provider.h>
const char * __clk_get_name(const struct clk * clk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/cpumask.h>
struct cpumask __cpu_active_mask;
#include <linux/irqdomain.h>
struct irq_domain * __irq_domain_add(struct fwnode_handle * fwnode,unsigned int size,irq_hw_number_t hwirq_max,int direct_max,const struct irq_domain_ops * ops,void * host_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <asm-generic/percpu.h>
unsigned long __per_cpu_offset[NR_CPUS] = {};
#include <linux/printk.h>
int __printk_ratelimit(const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_enter(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_exit(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched/task.h>
void __put_task_struct(struct task_struct * tsk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
int _printk_deferred(const char * fmt,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/random.h>
void add_device_randomness(const void * buf,size_t len)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int add_uevent_var(struct kobj_uevent_env * env,const char * format,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
async_cookie_t async_schedule_node(async_func_t func,void * data,int node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
void async_synchronize_full(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
void ct_irq_enter_irqson(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/context_tracking_irq.h>
void ct_irq_exit_irqson(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/leds.h>
int devm_led_classdev_register_ext(struct device * parent,struct led_classdev * led_cdev,struct led_init_data * init_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/dma-map-ops.h>
bool dma_default_coherent;
#include <asm-generic/softirq_stack.h>
void do_softirq_own_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
asmlinkage __visible void dump_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/rcuwait.h>
void finish_rcuwait(struct rcuwait * w)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 guid_index[16] = {};
#include <linux/irq.h>
void handle_fasteoi_irq(struct irq_desc * desc)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/init.h>
bool initcall_debug;
extern void input_dev_poller_finalize(struct input_dev_poller * poller);
void input_dev_poller_finalize(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_start(struct input_dev_poller * poller);
void input_dev_poller_start(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_stop(struct input_dev_poller * poller);
void input_dev_poller_stop(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_create_memless(struct input_dev * dev,void * data,int (* play_effect)(struct input_dev *,void *,struct ff_effect *))
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_event(struct input_dev * dev,unsigned int type,unsigned int code,int value)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_mt_release_slots(struct input_dev * dev);
void input_mt_release_slots(struct input_dev * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void __sched io_schedule(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void io_schedule_finish(int token)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
int io_schedule_prepare(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
long __sched io_schedule_timeout(long timeout)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/swiotlb.h>
struct io_tlb_mem io_tlb_default_mem;
#include <linux/interrupt.h>
int irq_can_set_affinity(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_domain_free_irqs_common(struct irq_domain * domain,unsigned int virq,unsigned int nr_irqs)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_domain_set_info(struct irq_domain * domain,unsigned int virq,irq_hw_number_t hwirq,const struct irq_chip * chip,void * chip_data,irq_flow_handler_t handler,void * handler_data,const char * handler_name)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq.h>
void irq_modify_status(unsigned int irq,unsigned long clr,unsigned long set)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_set_affinity(unsigned int irq,const struct cpumask * cpumask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_set_default_host(struct irq_domain * domain)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqnr.h>
struct irq_desc * irq_to_desc(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq_work.h>
void irq_work_tick(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/slab.h>
void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp_t flags)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_synth_uevent(struct kobject * kobj,const char * buf,size_t count)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * envp_ext[])
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/delay.h>
unsigned long lpj_fine;
#include <linux/of_device.h>
void of_device_uevent(struct device * dev,struct kobj_uevent_env * env)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
struct property * of_find_property(const struct device_node * np,const char * name,int * lenp)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
const struct fwnode_operations of_fwnode_ops;
#include <linux/of.h>
const char * of_prop_next_string(struct property * prop,const char * cur)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/of.h>
int of_property_read_string(const struct device_node * np,const char * propname,const char ** out_string)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
void smp_call_function_many(const struct cpumask * mask,smp_call_func_t func,void * info,bool wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/jump_label.h>
bool static_key_initialized;
#include <linux/clockchips.h>
void tick_broadcast(const struct cpumask * mask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_add(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_del(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
struct timerqueue_node * timerqueue_iterate_next(struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_block_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_clear_halt(struct usb_device * dev,int pipe)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_devio_cleanup(void);
void usb_devio_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware);
void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_free_streams(struct usb_interface * interface,struct usb_host_endpoint ** eps,unsigned int num_eps,gfp_t mem_flags)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_get_device_descriptor(struct usb_device * dev,unsigned int size);
int usb_get_device_descriptor(struct usb_device * dev,unsigned int size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_get_status(struct usb_device * dev,int recip,int type,int target,void * data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_alloc_bandwidth(struct usb_device * udev,struct usb_host_config * new_config,struct usb_host_interface * cur_alt,struct usb_host_interface * new_alt)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_find_raw_port_number(struct usb_hcd * hcd,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_hub_create_port_device(struct usb_hub * hub,int port1);
int usb_hub_create_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_hub_remove_port_device(struct usb_hub * hub,int port1);
void usb_hub_remove_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_interrupt_msg(struct usb_device * usb_dev,unsigned int pipe,void * data,int len,int * actual_length,int timeout)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_major_cleanup(void);
void usb_major_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/of.h>
struct device_node * usb_of_get_device_node(struct usb_device * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_set_isoch_delay(struct usb_device * dev);
int usb_set_isoch_delay(struct usb_device * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/ch9.h>
const char * usb_speed_string(enum usb_device_speed speed)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_unlink_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_unpoison_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 uuid_index[16] = {};
#include <linux/sched/wake_q.h>
void wake_q_add_safe(struct wake_q_head * head,struct task_struct * task)
{
lx_emul_trace_and_stop(__func__);
}

View File

@ -0,0 +1,70 @@
arch/arm64/lib/memcmp.S
arch/arm64/lib/strchr.S
arch/arm64/lib/strcmp.S
arch/arm64/lib/strlen.S
arch/arm64/lib/strncmp.S
drivers/base/bus.c
drivers/base/core.c
drivers/base/class.c
drivers/base/devres.c
drivers/base/driver.c
drivers/base/dd.c
drivers/base/property.c
drivers/hid/hid-apple.c
drivers/hid/hid-cherry.c
drivers/hid/hid-core.c
drivers/hid/hid-generic.c
drivers/hid/hid-holtek-mouse.c
drivers/hid/hid-input.c
drivers/hid/hid-microsoft.c
drivers/hid/hid-quirks.c
drivers/hid/usbhid/hid-core.c
drivers/input/input.c
drivers/usb/core/config.c
drivers/usb/core/driver.c
drivers/usb/core/generic.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/core/usb.c
kernel/kthread.c
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/rwsem.c
kernel/notifier.c
kernel/sched/build_utility.c
kernel/smpboot.c
kernel/softirq.c
kernel/time/clockevents.c
kernel/time/clocksource.c
kernel/time/hrtimer.c
kernel/time/jiffies.c
kernel/time/ntp.c
kernel/time/tick-broadcast.c
kernel/time/tick-broadcast-hrtimer.c
kernel/time/tick-common.c
kernel/time/tick-oneshot.c
kernel/time/tick-sched.c
kernel/time/time.c
kernel/time/timeconv.c
kernel/time/timecounter.c
kernel/time/timekeeping.c
kernel/time/timer.c
kernel/time/timer_list.c
kernel/workqueue.c
mm/util.c
lib/bitmap.c
lib/ctype.c
lib/find_bit.c
lib/hexdump.c
lib/hweight.c
lib/idr.c
lib/kasprintf.c
lib/klist.c
lib/kobject.c
lib/kstrtox.c
lib/radix-tree.c
lib/xarray.c
lib/siphash.c
lib/string.c
lib/string_helpers.c
lib/vsprintf.c

View File

@ -0,0 +1,5 @@
REQUIRES := arm_64
SRC_C += lx_emul/shadow/arch/arm64/kernel/smp.c
include $(PRG_DIR)/../../target.inc

View File

@ -0,0 +1,498 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit
* \date 2023-06-28
*/
#include <lx_emul.h>
#include <linux/ratelimit_types.h>
int ___ratelimit(struct ratelimit_state * rs,const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/cpumask.h>
struct cpumask __cpu_active_mask;
#include <linux/printk.h>
int __printk_ratelimit(const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_enter(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_exit(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched/task.h>
void __put_task_struct(struct task_struct * tsk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uaccess.h>
unsigned long _copy_to_user(void __user * to,const void * from,unsigned long n)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
int _printk_deferred(const char * fmt,...)
{
lx_emul_trace_and_stop(__func__);
}
extern void ack_bad_irq(unsigned int irq);
void ack_bad_irq(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/random.h>
void add_device_randomness(const void * buf,size_t len)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int add_uevent_var(struct kobj_uevent_env * env,const char * format,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
async_cookie_t async_schedule_node(async_func_t func,void * data,int node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
void async_synchronize_full(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/leds.h>
int devm_led_classdev_register_ext(struct device * parent,struct led_classdev * led_cdev,struct led_init_data * init_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
u64 div64_u64(u64 dividend,u64 divisor)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
u64 div64_u64_rem(u64 dividend,u64 divisor,u64 * remainder)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/math64.h>
s64 div_s64_rem(s64 dividend,s32 divisor,s32 * remainder)
{
lx_emul_trace_and_stop(__func__);
}
#include <asm-generic/softirq_stack.h>
void do_softirq_own_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
asmlinkage __visible void dump_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/rcuwait.h>
void finish_rcuwait(struct rcuwait * w)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 guid_index[16] = {};
#include <linux/sched.h>
unsigned long init_stack[THREAD_SIZE / sizeof(unsigned long)] = {};
#include <linux/init.h>
bool initcall_debug;
extern void input_dev_poller_finalize(struct input_dev_poller * poller);
void input_dev_poller_finalize(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_start(struct input_dev_poller * poller);
void input_dev_poller_start(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_stop(struct input_dev_poller * poller);
void input_dev_poller_stop(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_create_memless(struct input_dev * dev,void * data,int (* play_effect)(struct input_dev *,void *,struct ff_effect *))
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_event(struct input_dev * dev,unsigned int type,unsigned int code,int value)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_mt_release_slots(struct input_dev * dev);
void input_mt_release_slots(struct input_dev * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void __sched io_schedule(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void io_schedule_finish(int token)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
int io_schedule_prepare(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
long __sched io_schedule_timeout(long timeout)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_can_set_affinity(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_set_affinity(unsigned int irq,const struct cpumask * cpumask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq_work.h>
void irq_work_tick(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/slab.h>
void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp_t flags)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_synth_uevent(struct kobject * kobj,const char * buf,size_t count)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * envp_ext[])
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/moduleparam.h>
int param_set_copystring(const char * val,const struct kernel_param * kp)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
void smp_call_function_many(const struct cpumask * mask,smp_call_func_t func,void * info,bool wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
int smp_call_function_single(int cpu,smp_call_func_t func,void * info,int wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/jump_label.h>
bool static_key_initialized;
#include <linux/timerqueue.h>
bool timerqueue_add(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_del(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
struct timerqueue_node * timerqueue_iterate_next(struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_block_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_clear_halt(struct usb_device * dev,int pipe)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_devio_cleanup(void);
void usb_devio_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware);
void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_free_streams(struct usb_interface * interface,struct usb_host_endpoint ** eps,unsigned int num_eps,gfp_t mem_flags)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_get_device_descriptor(struct usb_device * dev,unsigned int size);
int usb_get_device_descriptor(struct usb_device * dev,unsigned int size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_get_status(struct usb_device * dev,int recip,int type,int target,void * data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_alloc_bandwidth(struct usb_device * udev,struct usb_host_config * new_config,struct usb_host_interface * cur_alt,struct usb_host_interface * new_alt)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_find_raw_port_number(struct usb_hcd * hcd,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_hub_create_port_device(struct usb_hub * hub,int port1);
int usb_hub_create_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_hub_remove_port_device(struct usb_hub * hub,int port1);
void usb_hub_remove_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_interrupt_msg(struct usb_device * usb_dev,unsigned int pipe,void * data,int len,int * actual_length,int timeout)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_major_cleanup(void);
void usb_major_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_set_isoch_delay(struct usb_device * dev);
int usb_set_isoch_delay(struct usb_device * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/ch9.h>
const char * usb_speed_string(enum usb_device_speed speed)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_unlink_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_unpoison_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 uuid_index[16] = {};
#include <linux/sched/wake_q.h>
void wake_q_add_safe(struct wake_q_head * head,struct task_struct * task)
{
lx_emul_trace_and_stop(__func__);
}

View File

@ -0,0 +1,64 @@
arch/x86/lib/hweight.S
drivers/base/bus.c
drivers/base/core.c
drivers/base/class.c
drivers/base/devres.c
drivers/base/driver.c
drivers/base/dd.c
drivers/base/property.c
drivers/hid/hid-apple.c
drivers/hid/hid-cherry.c
drivers/hid/hid-core.c
drivers/hid/hid-generic.c
drivers/hid/hid-holtek-mouse.c
drivers/hid/hid-input.c
drivers/hid/hid-microsoft.c
drivers/hid/hid-quirks.c
drivers/hid/usbhid/hid-core.c
drivers/input/input.c
drivers/usb/core/config.c
drivers/usb/core/driver.c
drivers/usb/core/generic.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/core/usb.c
kernel/kthread.c
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/rwsem.c
kernel/notifier.c
kernel/sched/build_utility.c
kernel/smpboot.c
kernel/softirq.c
kernel/time/clockevents.c
kernel/time/clocksource.c
kernel/time/hrtimer.c
kernel/time/jiffies.c
kernel/time/ntp.c
kernel/time/tick-broadcast.c
kernel/time/tick-common.c
kernel/time/tick-oneshot.c
kernel/time/tick-sched.c
kernel/time/time.c
kernel/time/timeconv.c
kernel/time/timecounter.c
kernel/time/timekeeping.c
kernel/time/timer.c
kernel/time/timer_list.c
kernel/workqueue.c
mm/util.c
lib/bitmap.c
lib/ctype.c
lib/find_bit.c
lib/hexdump.c
lib/idr.c
lib/kasprintf.c
lib/klist.c
lib/kobject.c
lib/kstrtox.c
lib/radix-tree.c
lib/xarray.c
lib/siphash.c
lib/string.c
lib/string_helpers.c
lib/vsprintf.c

View File

@ -0,0 +1,3 @@
REQUIRES := x86_32
include $(PRG_DIR)/../../target.inc

View File

@ -0,0 +1,466 @@
/*
* \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit
* \date 2023-06-26
*/
#include <lx_emul.h>
#include <linux/ratelimit_types.h>
int ___ratelimit(struct ratelimit_state * rs,const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/cpumask.h>
struct cpumask __cpu_active_mask;
#include <linux/printk.h>
int __printk_ratelimit(const char * func)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_enter(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
void __printk_safe_exit(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched/task.h>
void __put_task_struct(struct task_struct * tsk)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uaccess.h>
unsigned long _copy_to_user(void __user * to,const void * from,unsigned long n)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
int _printk_deferred(const char * fmt,...)
{
lx_emul_trace_and_stop(__func__);
}
extern void ack_bad_irq(unsigned int irq);
void ack_bad_irq(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/random.h>
void add_device_randomness(const void * buf,size_t len)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int add_uevent_var(struct kobj_uevent_env * env,const char * format,...)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
async_cookie_t async_schedule_node(async_func_t func,void * data,int node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/async.h>
void async_synchronize_full(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/leds.h>
int devm_led_classdev_register_ext(struct device * parent,struct led_classdev * led_cdev,struct led_init_data * init_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h>
asmlinkage __visible void dump_stack(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/rcuwait.h>
void finish_rcuwait(struct rcuwait * w)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 guid_index[16] = {};
#include <linux/init.h>
bool initcall_debug;
extern void input_dev_poller_finalize(struct input_dev_poller * poller);
void input_dev_poller_finalize(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_start(struct input_dev_poller * poller);
void input_dev_poller_start(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_dev_poller_stop(struct input_dev_poller * poller);
void input_dev_poller_stop(struct input_dev_poller * poller)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_create_memless(struct input_dev * dev,void * data,int (* play_effect)(struct input_dev *,void *,struct ff_effect *))
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/input.h>
int input_ff_event(struct input_dev * dev,unsigned int type,unsigned int code,int value)
{
lx_emul_trace_and_stop(__func__);
}
extern void input_mt_release_slots(struct input_dev * dev);
void input_mt_release_slots(struct input_dev * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void __sched io_schedule(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
void io_schedule_finish(int token)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
int io_schedule_prepare(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/sched.h>
long __sched io_schedule_timeout(long timeout)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/swiotlb.h>
struct io_tlb_mem io_tlb_default_mem;
#include <linux/interrupt.h>
int irq_can_set_affinity(unsigned int irq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/interrupt.h>
int irq_set_affinity(unsigned int irq,const struct cpumask * cpumask)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irq_work.h>
void irq_work_tick(void)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/slab.h>
void * kmem_cache_alloc_lru(struct kmem_cache * cachep,struct list_lru * lru,gfp_t flags)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_synth_uevent(struct kobject * kobj,const char * buf,size_t count)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/kobject.h>
int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * envp_ext[])
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/moduleparam.h>
int param_set_copystring(const char * val,const struct kernel_param * kp)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
void smp_call_function_many(const struct cpumask * mask,smp_call_func_t func,void * info,bool wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/smp.h>
int smp_call_function_single(int cpu,smp_call_func_t func,void * info,int wait)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/jump_label.h>
bool static_key_initialized;
#include <linux/timerqueue.h>
bool timerqueue_add(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
bool timerqueue_del(struct timerqueue_head * head,struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/timerqueue.h>
struct timerqueue_node * timerqueue_iterate_next(struct timerqueue_node * node)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_block_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_clear_halt(struct usb_device * dev,int pipe)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_devio_cleanup(void);
void usb_devio_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware);
void usb_disable_endpoint(struct usb_device * dev,unsigned int epaddr,bool reset_hardware)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_free_streams(struct usb_interface * interface,struct usb_host_endpoint ** eps,unsigned int num_eps,gfp_t mem_flags)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_get_device_descriptor(struct usb_device * dev,unsigned int size);
int usb_get_device_descriptor(struct usb_device * dev,unsigned int size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_get_status(struct usb_device * dev,int recip,int type,int target,void * data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_alloc_bandwidth(struct usb_device * udev,struct usb_host_config * new_config,struct usb_host_interface * cur_alt,struct usb_host_interface * new_alt)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/hcd.h>
int usb_hcd_find_raw_port_number(struct usb_hcd * hcd,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_hub_create_port_device(struct usb_hub * hub,int port1);
int usb_hub_create_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_hub_remove_port_device(struct usb_hub * hub,int port1);
void usb_hub_remove_port_device(struct usb_hub * hub,int port1)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_interrupt_msg(struct usb_device * usb_dev,unsigned int pipe,void * data,int len,int * actual_length,int timeout)
{
lx_emul_trace_and_stop(__func__);
}
extern void usb_major_cleanup(void);
void usb_major_cleanup(void)
{
lx_emul_trace_and_stop(__func__);
}
extern int usb_set_isoch_delay(struct usb_device * dev);
int usb_set_isoch_delay(struct usb_device * dev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb/ch9.h>
const char * usb_speed_string(enum usb_device_speed speed)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
int usb_unlink_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/usb.h>
void usb_unpoison_urb(struct urb * urb)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/uuid.h>
const u8 uuid_index[16] = {};
#include <linux/sched/wake_q.h>
void wake_q_add_safe(struct wake_q_head * head,struct task_struct * task)
{
lx_emul_trace_and_stop(__func__);
}

View File

@ -0,0 +1,64 @@
arch/x86/lib/hweight.S
drivers/base/bus.c
drivers/base/core.c
drivers/base/class.c
drivers/base/devres.c
drivers/base/driver.c
drivers/base/dd.c
drivers/base/property.c
drivers/hid/hid-apple.c
drivers/hid/hid-cherry.c
drivers/hid/hid-core.c
drivers/hid/hid-generic.c
drivers/hid/hid-holtek-mouse.c
drivers/hid/hid-input.c
drivers/hid/hid-microsoft.c
drivers/hid/hid-quirks.c
drivers/hid/usbhid/hid-core.c
drivers/input/input.c
drivers/usb/core/config.c
drivers/usb/core/driver.c
drivers/usb/core/generic.c
drivers/usb/core/hub.c
drivers/usb/core/quirks.c
drivers/usb/core/usb.c
kernel/kthread.c
kernel/locking/mutex.c
kernel/locking/osq_lock.c
kernel/locking/rwsem.c
kernel/notifier.c
kernel/sched/build_utility.c
kernel/smpboot.c
kernel/softirq.c
kernel/time/clockevents.c
kernel/time/clocksource.c
kernel/time/hrtimer.c
kernel/time/jiffies.c
kernel/time/ntp.c
kernel/time/tick-broadcast.c
kernel/time/tick-common.c
kernel/time/tick-oneshot.c
kernel/time/tick-sched.c
kernel/time/time.c
kernel/time/timeconv.c
kernel/time/timecounter.c
kernel/time/timekeeping.c
kernel/time/timer.c
kernel/time/timer_list.c
kernel/workqueue.c
mm/util.c
lib/bitmap.c
lib/ctype.c
lib/find_bit.c
lib/hexdump.c
lib/idr.c
lib/kasprintf.c
lib/klist.c
lib/kobject.c
lib/kstrtox.c
lib/radix-tree.c
lib/xarray.c
lib/siphash.c
lib/string.c
lib/string_helpers.c
lib/vsprintf.c

View File

@ -0,0 +1,3 @@
REQUIRES := x86_64
include $(PRG_DIR)/../../target.inc

View File

@ -0,0 +1,36 @@
TARGET = usb_hid_drv
LIBS = base jitterentropy virt_lx_emul
INC_DIR = $(PRG_DIR)/../.. $(REP_DIR)/src/lib/usb_client
SRC_C += dummies.c \
generated_dummies.c \
led.c \
lx_emul.c \
lx_user.c
SRC_C += lx_emul/shadow/drivers/input/evdev.c \
lx_emul/virt/shadow/drivers/usb/core/message.c \
lx_emul/virt/shadow/drivers/usb/core/urb.c \
lx_emul/virt/usb_client.c
SRC_CC = main.cc
SRC_CC += lx_emul/event.cc \
lx_emul/random.cc
SRC_CC += genode_c_api/event.cc \
genode_c_api/usb_client.cc
vpath %.c $(PRG_DIR)
vpath %.c $(PRG_DIR)/../..
vpath %.cc $(PRG_DIR)/../..
vpath %.c $(REP_DIR)/src/lib
vpath %.cc $(REP_DIR)/src/lib
C_API = $(dir $(call select_from_repositories,src/lib/genode_c_api))
vpath genode_c_api/event.cc $(C_API)
vpath genode_c_api/usb_client.cc $(C_API)
# vim: set ft=make :

View File

@ -0,0 +1,34 @@
/*
* \brief C/C++ interface for this driver
* \author Sebastian Sumpf
* \date 2023-06-29
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <genode_c_api/usb_client.h>
#include <lx_emul/usb_client.h>
#ifdef __cplusplus
extern "C" {
#endif
struct task_struct;
int lx_user_main_task(void *);
struct task_struct *lx_user_new_usb_task(int (*func)(void*), void *args);
void lx_user_destroy_usb_task(struct task_struct*);
void lx_led_state_update(bool capslock, bool numlock, bool scrlock);
#ifdef __cplusplus
} /* extern "C" */
#endif