haiku/headers/private/kernel/kmodule.h
Jérôme Duval 8e17b43da6 kernel/device_manager: Implement B_GET_DRIVER_FOR_DEVICE
for legacy and new drivers.

This is an opcode for ioctl that can be used on almost any device entry found in /dev.
When used, ioctl will fill a buffer with the absolute path to the driver file that is
being used by the device.

This opcode was available in BeOS R5, though remained unimplemented in Haiku since
the introduction of the Device Manager almost two decades ago.

Original change by Jacob Secunda.

Change-Id: Ic49141b677b4158a63918459d4048450c825447c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5078
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-10-17 06:13:07 +00:00

42 lines
953 B
C++

/*
* Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_MODULE_H
#define _KERNEL_MODULE_H
#include <drivers/module.h>
#include <kernel.h>
struct kernel_args;
#ifdef __cplusplus
// C++ only part
class NotificationListener;
extern status_t start_watching_modules(const char *prefix,
NotificationListener &listener);
extern status_t stop_watching_modules(const char *prefix,
NotificationListener &listener);
extern "C" {
#endif
extern status_t unload_module(const char *path);
extern status_t load_module(const char *path, module_info ***_modules);
extern status_t module_init(struct kernel_args *args);
extern status_t module_init_post_threads(void);
extern status_t module_init_post_boot_device(bool bootingFromBootLoaderVolume);
extern status_t module_get_path(const char* moduleName, char** path);
#ifdef __cplusplus
}
#endif
#endif /* _KRENEL_MODULE_H */