forked from latentPrion/zambesii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The kernel's build process now scans for all UDIProps files and adds …
…them to the index. Also added some test udiprops for some devices.
- Loading branch information
1 parent
5868158
commit a9b02a5
Showing
13 changed files
with
534 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ foo | |
*.iso | ||
/Makefile.vars | ||
/Makefile | ||
*.zudi-index | ||
|
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,51 @@ | ||
|
||
#include <in_asm.h> | ||
#include <assembler.h> | ||
|
||
.section .rodata | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_driver_headers) | ||
.incbin "driver-headers.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_driver_headers) | ||
ASM_GLOBAL_DATA(chipset_udi_index_driver_headers_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_driver_data) | ||
.incbin "driver-data.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_driver_data) | ||
ASM_GLOBAL_DATA(chipset_udi_index_driver_data_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_regions) | ||
.incbin "regions.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_regions) | ||
ASM_GLOBAL_DATA(chipset_udi_index_region_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_devices) | ||
.incbin "devices.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_devices) | ||
ASM_GLOBAL_DATA(chipset_udi_index_devices_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_ranks) | ||
.incbin "ranks.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_ranks) | ||
ASM_GLOBAL_DATA(chipset_udi_index_ranks_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_messages) | ||
.incbin "messages.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_messages) | ||
ASM_GLOBAL_DATA(chipset_udi_index_device_messages_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_disaster_messages) | ||
.incbin "disaster-messages.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_disaster_messages) | ||
ASM_GLOBAL_DATA(chipset_udi_index_device_disaster_messages_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_message_files) | ||
.incbin "message-files.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_message_files) | ||
ASM_GLOBAL_DATA(chipset_udi_index_device_message_files_end) | ||
|
||
ASM_GLOBAL_DATA(chipset_udi_index_readable_files) | ||
.incbin "readable-files.zudi-index" | ||
ASM_END_DATA(chipset_udi_index_readable_files) | ||
ASM_GLOBAL_DATA(chipset_udi_index_device_readable_files_end) | ||
|
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,75 @@ | ||
|
||
#define UDI_VERSION 0x101 | ||
#include <kernel/common/floodplainn/udi/udi.h> | ||
|
||
|
||
/* Data type used to represent i8254-pit CLK cycles. CLK cycles are /not/ 1:1 | ||
* related to actual microseconds. The i8254 PIT has an input frequency of | ||
* 1,193,180Hz. | ||
**/ | ||
typedef udi_ubit16_t timer_clk_t; | ||
|
||
struct timerRDataS | ||
{ | ||
enum timerIrqStatusE { IRQ_DISABLED, IRQ_ENABLED }; | ||
enum timerApiStatusE { API_DISABLED, API_ENABLED }; | ||
enum timerModeE { ONESHOT, PERIODIC }; | ||
|
||
// Whether or not the channel 0 IRQ is active. | ||
timerIrqStatusE irqStatus; | ||
// Whether or not the device is logically enabled currently. | ||
timerApiStatusE apiStatus; | ||
timerModeE timerMode; | ||
// The current value programmed into the counter register. | ||
timer_clk_t currentClkVal; | ||
// The current microsecond time requested by the bound child. | ||
udi_time_t currentTimeoutVal; | ||
}; | ||
|
||
struct speakerRDataS | ||
{ | ||
}; | ||
|
||
static udi_channel_event_ind_op_t timer_intr_channel_event_ind; | ||
static udi_intr_event_ind_op_t timer_intr_event_ind; | ||
|
||
static udi_intr_dispatcher_ops_t | ||
{ | ||
&timer_intr_channel_event_ind, | ||
&timer_intr_event_ind | ||
} timer_intr_dispatcher_ops; | ||
|
||
void timer_intr_event_ind(udi_intr_event_cb_t *cb, udi_ubit8_t flags) | ||
{ | ||
timerRDataS *timerData; | ||
|
||
timerData = (timerRDataS *)cb->gcb.context; | ||
|
||
// If the IRQ is disabled, don't claim the IRQ. | ||
if (timerData->irqStatus == timerRDataS::IRQ_DISABLED) | ||
{ | ||
cb->intr_result = UDI_INTR_UNCLAIMED; | ||
udi_intr_event_rdy(cb); | ||
return; | ||
}; | ||
|
||
/* ELSE: | ||
* If API status is API_ENABLED: | ||
* This is a normal IRQ. | ||
* If API status is API_DISABLED: | ||
* This is a "shutting down" IRQ. | ||
**/ | ||
switch (timerData->apiStatus) | ||
{ | ||
case timerRDataS::API_DISABLED: | ||
// Call udi_intr_detach_req(). | ||
return; | ||
|
||
default: | ||
/* Normal case: Normal IRQ has occured. Call | ||
* zudi_timer_event_ind. | ||
**/ | ||
//udi_cb_alloc(&timer_intr_event_ind_normal_cb_alloc, ...); | ||
return; | ||
} | ||
|
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 @@ | ||
# UDI static properties for the IBM-PC i8254 PIT. | ||
# | ||
properties_version 0x101 | ||
|
||
message 1 IBM-PC i8254-PIT driver | ||
message 2 Zambesii | ||
message 3 http://github.com/latentprion/zambesii | ||
|
||
name 1 | ||
shortname i8254_pit | ||
supplier 2 | ||
contact 3 | ||
release 1 0.00.000 | ||
|
||
requires udi 0x101 | ||
requires zudi_gio 0x101 | ||
requires zbz_timer 0x1 | ||
requires zudi_physio 0x101 | ||
requires zbz_pcisa 0x1 | ||
|
||
meta 1 zbz_timer | ||
meta 2 zbz_pcisa | ||
meta 3 zudi_gio | ||
|
||
# child_bind_ops 1 0 # Unknown ops_idx for now. | ||
# parent_bind_ops 2 0 # Unknown ops_idx and cb_idx for now. | ||
# internal_bind_ops 3 1 # Unknown ops_idx0, ops_idx1 and cb_idx for now. | ||
|
||
message 4 IBM-PC compatible i8254 PIT | ||
device 4 2 \ | ||
bus_type string pcisa \ | ||
pcisa_device_name string i8254-pit \ | ||
|
||
module i8254_pit | ||
# Primary region handles the channel 0 timer. | ||
region 0 type interrupt | ||
# Secondary region handles the PC speaker. | ||
region 1 | ||
|
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,37 @@ | ||
# Test udiprops for an rs-232 serial device. | ||
properties_version 0x101 | ||
|
||
message 1 IBM-PC rs-232 driver | ||
message 2 Zambesii | ||
message 3 N/A | ||
|
||
name 1 | ||
supplier 2 | ||
contact 3 | ||
shortname pc_rs232 | ||
release 1 v0.00.000 | ||
|
||
module main | ||
|
||
requires udi 0x101 | ||
requires udi_bridge 0x101 | ||
requires udi_physio 0x101 | ||
requires udi_nic 0x101 | ||
requires udi_pci 0x101 | ||
|
||
region 0 | ||
region 1 type interrupt | ||
|
||
meta 1 udi_nic | ||
meta 2 udi_pci | ||
|
||
message 100 IBM-PC RS-232 Serial (COM) | ||
device 100 2 \ | ||
bus_type string pci \ | ||
pci_vendor_id ubit32 0x1234 \ | ||
pci_device_id ubit32 0x5678 | ||
|
||
#parent_bind_ops | ||
#child_bind_ops | ||
#internal_bind_ops | ||
|
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,21 @@ | ||
properties_version 0x101 | ||
|
||
message 1 PC RTC Driver | ||
message 2 Zambesii | ||
message 3 N/A | ||
|
||
name 1 | ||
supplier 2 | ||
contact 3 | ||
shortname pc_rtc | ||
release 1 v0.00.000 | ||
|
||
module main | ||
|
||
requires udi 0x101 | ||
requires udi_physio 0x101 | ||
requires udi_gio 0x101 | ||
|
||
region 0 | ||
|
||
# |
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
Oops, something went wrong.