[DragonFlyBSD - Submit #3042] (New) firmware: endianness support for fw_stub.awk

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sat Jun 3 03:30:17 PDT 2017


Issue #3042 has been reported by sucanjan at fit.cvut.cz.

----------------------------------------
Submit #3042: firmware: endianness support for fw_stub.awk
http://bugs.dragonflybsd.org/issues/3042

* Author: sucanjan at fit.cvut.cz
* Status: New
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
----------------------------------------
Hello,

this patch adds an optional parameter to a firmware specification
tuple for the fw_stub.awk script. The argument is a path to the
big-endian version of the firmware. If it is provided by the user, the
first path in the tuple is treated as little-endian, and two calls of
firmware_register() are generated by the script. The calls are
compiled conditionally according to endianness of target machine.

This is needed for the isp driver firmware to be moved from uit16_t C
arrays in header files to .uu files in sys/contrib/dev/isp.

Example of generated C source code:

#if BYTE_ORDER == BIG_ENDIAN
    fp = firmware_register("name", _binary_BigEndianFW_start , (size_t)(_binary_BigEndianFW_end - _binary_BigEndianFW_start), 1234, NULL);
#else
    fp = firmware_register("name", _binary_firmware_start , (size_t)(_binary_firmware_end - _binary_firmware_start), 1234, NULL);
#endif


---Files--------------------------------
0001-firmware-endianness-support-for-fw_stub.awk.patch (3.58 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Submit mailing list