)]}'
{
  "commit": "15daa83ee2abb7abecc0140bcbe043a013111dfd",
  "tree": "c9164914af2e37d2d7cfe79bee97a3c467c27a48",
  "parents": [
    "9aeaac797a34043b2a04424f3128d3dc02e75c4c"
  ],
  "author": {
    "name": "Timothy Trippel",
    "email": "ttrippel@google.com",
    "time": "Tue Nov 30 00:38:11 2021 +0000"
  },
  "committer": {
    "name": "Michael Munday",
    "email": "mike.munday@lowrisc.org",
    "time": "Thu Dec 02 09:57:32 2021 +0000"
  },
  "message": "[sw/ottf] Fix bugs saving/restoring stack pointer in ISRs.\n\nThe OTTF was optimized in #9158 to allow running bare-metal tests (in\nplace of running each test as a FreeRTOS \"task\") if the test did NOT\nrequire spawning (additional) concurrenct tasks.\n\nThis introduced a bug in the ISR assembly that saves/restores the current\nexecution context to the stack upon entry/exit from the ISR. For tests run\nas a FreeRTOS task, i.e., tests that set the `enable_concurrency` flag in\nthe test configuration struct (see `test_config_t` in\n`sw/device/lib/testing/test_framework/ottf.h`), the current stack pointer must\nbe saved/restored from the current Task Control Block (TCB) because each\nFreeRTOS task maintains a separate stack and a context switch could\nhappen in an exception handler (task yield) or ISR (preemption).\n\nHowever, for bare-metal tests, the current TCB pointer (which is initialized\nand maintained by FreeRTOS) is NULL. Therefore attempting to dereference\nsaid pointer results in a store access fault.\n\nThis commit fixes this bug by checking the test mode (bare-metal vs.\nconcurrency) in the ISR entry/exit assembly to store/load the proper\nexecution context state.\n\nSigned-off-by: Timothy Trippel \u003cttrippel@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b30ba7e8f740621123420d701e9e9ed73ac4fcf8",
      "old_mode": 33188,
      "old_path": "sw/device/lib/testing/test_framework/ottf.c",
      "new_id": "a5a8c10f266ded236a65d159c21952f0158062be",
      "new_mode": 33188,
      "new_path": "sw/device/lib/testing/test_framework/ottf.c"
    },
    {
      "type": "modify",
      "old_id": "71b2629993acf2f3906d19228bec8d88a417a848",
      "old_mode": 33188,
      "old_path": "sw/device/lib/testing/test_framework/ottf.h",
      "new_id": "9d106a3624c7efc2041d12ce92e9fa8748721603",
      "new_mode": 33188,
      "new_path": "sw/device/lib/testing/test_framework/ottf.h"
    },
    {
      "type": "modify",
      "old_id": "b77ed681b82625b1f7556fa979ae09572d9f4cd3",
      "old_mode": 33188,
      "old_path": "sw/device/lib/testing/test_framework/ottf_isrs.S",
      "new_id": "080c18dfbd0a610c6eab8a92db26661f03f744a3",
      "new_mode": 33188,
      "new_path": "sw/device/lib/testing/test_framework/ottf_isrs.S"
    },
    {
      "type": "modify",
      "old_id": "bbf22b9abe70230bdb9ad089be34d7f3785a2f87",
      "old_mode": 33188,
      "old_path": "sw/device/tests/ottf_example_bare_metal_test.c",
      "new_id": "fca7fc13ad213ea1820ef2043c434d54ac2c31c4",
      "new_mode": 33188,
      "new_path": "sw/device/tests/ottf_example_bare_metal_test.c"
    },
    {
      "type": "modify",
      "old_id": "564755ca9f122d61f7eed0462e03bc08eec98679",
      "old_mode": 33188,
      "old_path": "sw/device/tests/ottf_example_concurrency_test.c",
      "new_id": "ed411b2ea4482db29373810689d35328f57d7804",
      "new_mode": 33188,
      "new_path": "sw/device/tests/ottf_example_concurrency_test.c"
    }
  ]
}
