Changeset 5e718d9 in mainline for uspace/dist/src


Ignore:
Timestamp:
2012-08-21T10:04:16Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67edca6
Parents:
0da6c04 (diff), 6a97f2e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with upstream (lp:~wtachi/helenos/bithenge)

Location:
uspace/dist/src/bithenge
Files:
16 added
1 edited
7 moved

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/bithenge/repeat.bh

    r0da6c04 r5e718d9  
    2424        .without_count <- without_count <- known_length(9);
    2525        .do_while <- do_while;
     26        .do_while_item <- (.do_while[1]);
    2627};
  • uspace/dist/src/bithenge/usbdesc.bh

    r0da6c04 r5e718d9  
    77# Originally by Vojtech Horky.
    88
     9# Block prefixed with a byte length
     10transform block = (in.data) <- struct {
     11        .bLength <- uint8;
     12        .data <- known_length(.bLength - 1);
     13};
     14
    915# USB configuration descriptor
    1016# This is not the full configuration descriptor (i.e. with interface
    1117# and endpoint descriptors included) but only the header.
    1218transform usb_configuration_descriptor_bare = struct {
    13         .bLength <- uint8; # assert bLength = 9
    14         .bDescriptorType <- uint8; # assert: bDescriptorType == 2
    1519        .wTotalLength <- uint16le;
    1620        .bNumInterfaces <- uint8;
     
    2327# USB interface descriptor
    2428transform usb_interface_descriptor = struct {
    25         .bLength <- uint8; # assert bLength = 9
    26         .bDescriptorType <- uint8; # assert: bDescriptorType == 4
    2729        .bInterfaceNumber <- uint8;
    2830        .bAlternateSetting <- uint8;
     
    3638# USB endpoint descriptor
    3739transform usb_endpoint_descriptor = struct {
    38         .bLength <- uint8; # assert bLength = 7
    39         .bDescriptorType <- uint8; # assert: bDescriptorType == 5
    4040        .bEndpointAddress  <- uint8;
    4141        .bmAttributes <- uint8;
     
    4646# USB HID descriptor
    4747transform usb_hid_descriptor = struct {
    48         .bLength <- uint8;
    49         .bDescriptorType <- uint8; # assert: bDescriptorType == 33
    5048        .bcdHID <- uint16le;
    5149        .bCountryCode <- uint8;
    5250        .bNumDescriptors <- uint8;
    53         # Following is repeated bNumDescriptors times
    54         .bDescriptorType <- uint8;
    55         .wDescriptorLength <- uint16le;
     51        <- repeat(.bNumDescriptors) { struct {
     52                .bDescriptorType <- uint8;
     53                .wDescriptorLength <- uint16le;
     54        } };
    5655};
    5756
    58 # Fixed configuration for QEMU USB keyboard.
    59 transform qemu_usb_keyboard = struct {
    60         .configuration_descriptor <- usb_configuration_descriptor_bare;
    61         .interface_descriptor <- usb_interface_descriptor;
    62         .hid_descriptor <- usb_hid_descriptor;
    63         .endpoint_descriptor <- usb_endpoint_descriptor;
    64 };
     57# USB descriptor
     58transform usb_descriptor = struct {
     59        .bDescriptorType <- uint8;
     60        <- switch (.bDescriptorType) {
     61                 2: usb_configuration_descriptor_bare;
     62                 4: usb_interface_descriptor;
     63                 5: usb_endpoint_descriptor;
     64                33: usb_hid_descriptor;
     65        };
     66} <- block;
    6567
    66 transform main = qemu_usb_keyboard;
     68transform main = repeat { usb_descriptor };
Note: See TracChangeset for help on using the changeset viewer.