Fixes `relevant_mask` calculation in arm32_init() to use bitwise AND
instead of OR. The previous logic incorrectly validated bits outside the
hash region, preventing valid instructions like 'BX` from being added to
the lookup table.
Increased LOOKUP_TABLE_MAX_BUCKET_SIZE from 8 to 16. Instructions with
wildcard bits in the hash region (eg, AND, EOR) must map to multiple
buckets to ensure O(1) lookup.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Rewrites the Arm32 instruction decoder to align with high integrity
software standards such as MISRA C and BARR-C.
Key Architectural Changes:
- Added compile time validation.
- Removed dependency on memory allocator. The decoder now uses
statically allocated global storage.
- Implement a hash-based lookup table to reduce decoding complexity to
O(1).
- Removed decoder_t in favour of a singleton pattern.
- Add documentation stating thread safety, preconditions, and
postconditions for all public functions.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Introduces the core Arm32 decoder, including the instruction parsing
mechanism and an initial set of defined instructions.
Signed-off-by: Ronald Caesar <github43132@proton.me>
Strengthens the decoder's foundation but does not yet implement the core
instruction lookup table logic or the public arm32_decode API. These
will be addressed in future patches.
Signed-off-by: Ronald Caesar <github43132@proton.me>