-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm: Add uDRM subproject and bridge module
- Loading branch information
Showing
8 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// uAPI log.h implementation | ||
|
||
#include <menix/common.h> | ||
#include <menix/util/log.h> | ||
|
||
#include <uapi/status.h> | ||
#include <uapi/types.h> | ||
|
||
#define UAPI_KERNEL_API | ||
#define UAPI_WANTS_LOG | ||
#include <uapi/log.h> | ||
#undef UAPI_KERNEL_API | ||
|
||
void uapi_kernel_log(uapi_log_level level, const uapi_char* msg) | ||
{ | ||
switch (level) | ||
{ | ||
case UAPI_LOG_INFO: | ||
case UAPI_LOG_TRACE: | ||
case UAPI_LOG_DEBUG: print_log("uapi: %s", msg); break; | ||
case UAPI_LOG_WARN: print_warn("uapi: %s", msg); break; | ||
case UAPI_LOG_ERROR: print_error("uapi: %s", msg); break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Direct Rendering Manager | ||
|
||
add_module(udrm "Marvin Friedrich" "Direct Rendering Manager" MAIN OFF ON | ||
udrm_bridge.c | ||
udrm/src/udrm_core.c | ||
udrm/src/udrm_bochs.c | ||
) | ||
target_include_directories(${MENIX_CURRENT_MOD} PRIVATE udrm/include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// uDRM Bridge | ||
|
||
#include <menix/common.h> | ||
#include <menix/io/mmio.h> | ||
#include <menix/system/module.h> | ||
#include <menix/system/pci/pci.h> | ||
|
||
#include <udrm/kernel_api.h> | ||
#include <udrm/udrm.h> | ||
|
||
static i32 bochs_probe(PciDevice* dev) | ||
{ | ||
uapi_status status = udrm_bochs_probe(dev); | ||
return status; | ||
} | ||
|
||
static PciVariant bochs_variant = { | ||
.vendor = 0x1234, | ||
.device = 0x1111, | ||
}; | ||
|
||
static PciDriver bochs_driver = { | ||
.name = "udrm_bochs", | ||
.variants = &bochs_variant, | ||
.num_variants = 1, | ||
.probe = bochs_probe, | ||
}; | ||
|
||
static i32 init_fn() | ||
{ | ||
udrm_initialize(); | ||
|
||
// Register all device drivers. | ||
pci_register_driver(&bochs_driver); | ||
|
||
return 0; | ||
} | ||
|
||
MODULE_DEFAULT(init_fn, NULL); |