forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unaligned access with LTO #1
Merged
Merged
Conversation
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
…igned accesses by chibios with LTO enabled
tzarc
pushed a commit
that referenced
this pull request
Jan 8, 2020
…atrix timeout. (qmk#7688) * Added KidBrazil custom keymap for CRKBD -Custom Font -Custom OLED output * Added missing readme * Oled Timeout Update for KidBrazil Keymap (#1) * Setup Oled timeout based on simple timer * Cleaned up comments and added timeout for LEDs * Fixed some small errors * Updated oled timout with matrix scan * Updated oled timout with matrix scan * Update withou eeprom * Update timer code * Use process user instead of keymap * Added ifdef to protect oledtimer * Updated with half timeout state for logo * Removed middle tier timer * Final cleanup of unused files * Updated code as per suggestions & requests * Second round of revisions * Updated keymap to better handle LED timeout - Added boolean to hold LED state - Added init function to set rgb to known state - Modified RGB_TOG to work with noeeprom commands * Finished adding the timeout for OLED and testing on CRKBD * Updated documentation * fixed the timeout logic so it works as intended * Update keyboards/crkbd/keymaps/kidbrazil/README.md
tzarc
pushed a commit
that referenced
this pull request
Jan 27, 2020
…eout. (qmk#7901) * Added KidBrazil custom keymap for CRKBD -Custom Font -Custom OLED output * Added missing readme * Oled Timeout Update for KidBrazil Keymap (#1) * Setup Oled timeout based on simple timer * Cleaned up comments and added timeout for LEDs * Fixed some small errors * Updated oled timout with matrix scan * Updated oled timout with matrix scan * Update withou eeprom * Update timer code * Use process user instead of keymap * Added ifdef to protect oledtimer * Updated with half timeout state for logo * Removed middle tier timer * Final cleanup of unused files * Updated code as per suggestions & requests * Second round of revisions * Updated keymap to better handle LED timeout - Added boolean to hold LED state - Added init function to set rgb to known state - Modified RGB_TOG to work with noeeprom commands * Finished adding the timeout for OLED and testing on CRKBD * Updated documentation * fixed the timeout logic so it works as intended * Added initial limits to color settings * Added layer reset as part of the iddle timeout process * Split Keymap into more manageable files * Finalizing RGB Layer status on CRKBD - Refactored OLED timeout to deal only with oled - If user remains iddle on game layer for too long it will switch to default - LED / OLED iddle working - Minor changes to _SYM layer - Removed some rgb controls from keyboard due to layer dependent RGB colors * Update keyboards/crkbd/keymaps/kidbrazil/keymap.c Used suggestion from Drashna to replace EEPROM_RESET with shorter version. Co-Authored-By: Drashna Jaelre <[email protected]> * Update keyboards/crkbd/keymaps/kidbrazil/keymap.c Co-Authored-By: Drashna Jaelre <[email protected]> * Implemented drashna's comment Co-authored-by: Drashna Jaelre <[email protected]>
tzarc
pushed a commit
that referenced
this pull request
Feb 24, 2020
Fixing complexity remove lambda PR review fixes #1 Removing unneccesary string substitution Handle -a and specified files Complexity rewrite, use pathlib
tzarc
pushed a commit
that referenced
this pull request
May 7, 2020
* New keymap layout for dztech/dz65rgb/keymaps * New keymap layout for dztech/dz65rgb/keymaps - Conding conventions fixes * Fix typo in Leader Key table * PR qmk#8199 Feedback Commit #1 * Fixed data types and function names - Simplified accent macros by removing repetition - Added selection wrap macros - readme.md doc updated with changes * PR qmk#8199 second feedback commit - Clarified function names, variables names and comments * Fix: accent output fix _grave <==> _circumflex * dry fixes on led set_color with hsv and led blinking code blocks
tzarc
pushed a commit
that referenced
this pull request
Aug 4, 2022
* Userspace: muppetjones (#1) Add and update lily58 to work with userspace Add and update kyria keymap to work with userspace Add and update planck keymap with userspace Add etchamouse code and docs to userpace Add userspace Update mouse encoder for smoother movement. Encoder + mouse Added casemodes by andrewjrae * Rollback lily58 state reader and add missing GPL * Apply suggestions from code review Co-authored-by: Drashna Jaelre <[email protected]> Co-authored-by: Joel Challis <[email protected]> * fix lily58 keymap * Updates to user and lily for muppetjones. Updated parameters for etchamouse for smoother mouse movement. Updated lily keymap and userspace to actually work together. * Update keyboards/lily58/keymaps/muppetjones/config.h Co-authored-by: Drashna Jaelre <[email protected]> * Updated keymaps and userspace * Little more cleanup. * Update keyboards/lily58/keymaps/muppetjones/rules.mk Co-authored-by: Ryan <[email protected]> * Rollback accidental libchibios update * Apply suggestions from code review Co-authored-by: Drashna Jaelre <[email protected]> * Update kyria keymap * Move kyria keymap to splitkb/kyria * Update planck keymap * Remove all changes to keyboards/lily58/lib/layer_state_reader.c * Update lily58 keymap * Recommended change * Update keymap readme * Update kyria keymap and userspace * Apply suggestions from code review Co-authored-by: Drashna Jaelre <[email protected]> * Renamed users/muppetjones/README.md to lc * Update keyboards/lily58/keymaps/muppetjones/config.h Co-authored-by: Drashna Jaelre <[email protected]> Co-authored-by: Drashna Jaelre <[email protected]> Co-authored-by: Joel Challis <[email protected]> Co-authored-by: Ryan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Force 4 byte alignment on USB buffers. Chibios casts these buffers to
size_t*
before dereferencing them (os/hal/src/hal_buffers.c:633
, among other locations); in some cases this can result in an unaligned access if LTO decides to shift things around. Ideally the chibios API would express this alignment precondition, but this will ensure that all accesses to these buffers are aligned.There are several more APIs in which chibios performs an unsafe cast, but as far as I can tell this is the only one that might result in an unaligned access to QMK data.
I've been able to reliably reproduce this crash in the following configuration:
tzarc/qmk_firmware:chibios-upgrade
onekey/stm32f0_disco:rgb
This fix works for the same configuration and a few permutations (enable/disable NKRO & UNICODE). Also tested with
:default
as configured ontzarc/chibios-upgrade
.Description
Types of Changes
Issues Fixed or Closed by This PR
Checklist