)]}'
{
  "commit": "cf2a543085aaa479197f354a25e36a0e03dbd654",
  "tree": "67a1381f67990a49a16334fe2a87eb8c140268ac",
  "parents": [
    "a76b21316d9d22b641129795e081d41293be6f69",
    "b65c3c8e9ebb74053e9c17e0a1bda734cf61d643"
  ],
  "author": {
    "name": "bors[bot]",
    "email": "26634292+bors[bot]@users.noreply.github.com",
    "time": "Fri Jun 26 09:57:22 2020 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Jun 26 09:57:22 2020 +0000"
  },
  "message": "Merge #191\n\n191: Undefined instruction fix for start_item_arm r\u003dvalexandru a\u003dvalexandru\n\nI ported libtock-rs for the i.MX RT 1052 EVKB and while trying to run a simple hello_world application, when switching to the userspace, after running the first instruction, it failed with a hard fault. The cause of the hard fault was the instruction \"sub r4, pc, #4\" from the function _start in the core/src/entry_point/start_item_arm.rs file. The same instruction, simply run separately as \r\n`subw r4, pc, #4`\r\nseems to work. \r\n\r\nApparently, the reason for this was that my compiler on Mac OS compiled with T3 ARM Encoding which translated the instruction to \r\n`sub.w   r4, pc, #4`\r\n\r\nwhich caused hard fault with Undefined Instruction.\r\n\r\nThe reason for this is that for T3 encoding, if Rn \u003d\u003d PC, the behaviour is **upredictable**. More information about this can be found in the [ARMv7 Architecture Manual](https://static.docs.arm.com/ddi0403/eb/DDI0403E_B_armv7m_arm.pdf), section A7.7.171\r\nSUB (immediate), pages 448-449\r\n\r\nThe solution I propose: \r\n`mov r4, pc\r\nsub r4, r4, #4`\r\nas both work no matter what ARM encoding is used.\n\nCo-authored-by: Vochescu Alexandru \u003calexvochescu@gmail.com\u003e\n",
  "tree_diff": []
}
