Skip to content
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

Added MSP430 support #392

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Added MSP430 support #392

wants to merge 17 commits into from

Conversation

jfktrey
Copy link
Contributor

@jfktrey jfktrey commented Dec 20, 2018

Overview of changes:

  1. Added MSP430 support and bindings
  2. Added missing EVM bindings
  3. Fixed generation of Rust bindings in const_generator.py
  4. Modified constant generation for C#, as it was wrong out of the box
  5. Added basic test cases for MSP430

Adding support for MSP430 was not trivial, since the required MC* classes only landed in LLVM in the past month. This means the code had to be backported to the 3.9.0 release that Keystone seems to be based off of. In short, I took the corrected TableGen .td files describing MSP430 from the latest commit, fixed those up to be built on a 3.9.0 branch, and used those generated .inc files. The remaining files are taken directly from the latest LLVM commit and fixed up to work with the 3.9.0 code. I added a few methods to some shared files in order to get these to work, but most of this is self-contained.

I validated correct code assembly for some example programs using kstool.

@aquynh
Copy link
Member

aquynh commented Dec 23, 2018

wow this is amazing! could you provide the llvm commit that you based this on?

@aquynh
Copy link
Member

aquynh commented Dec 23, 2018

could you please split the bindings into separate pull reqs?

@jfktrey
Copy link
Contributor Author

jfktrey commented Jan 2, 2019

I ran TableGen using this commit as a base: llvm-mirror/llvm@ebec1ca

The *.td files themselves (and all the files for MSP430 under the Target/ folder) were taken from the latest LLVM commit as of when I cloned it: llvm-mirror/llvm@1b084f0 . Proper MSP430 support was added to LLVM in November, starting with this commit (and continuing in subsequent commits): llvm-mirror/llvm@695940b#diff-a2e1042efbf812d7279d8d7b393272f7

The TableGen files required some fairly minor modifications to work correctly. See the exact code I used for generating the *.inc files here: https://github.com/jfktrey/llvm/commits/msp430-keystone-integration

I will split the binding into a separate PR

@jfktrey
Copy link
Contributor Author

jfktrey commented Jan 2, 2019

Updated the CR to exclude bindings - I'll open up a separate PRs or two for those once this is merged, so that I can diff the PR against this commit for a cleaner review.

If you'd prefer it another way, just let me know!

@aquynh
Copy link
Member

aquynh commented Jan 4, 2019

please add your name to CREDITS.TXT too.

let me review this before merging, will take some time on this huge update.

@jfktrey
Copy link
Contributor Author

jfktrey commented Feb 6, 2019

Hi @aquynh , just wanted to see if you've had a chance to take a look or have any thoughts.

@aquynh
Copy link
Member

aquynh commented Feb 7, 2019

my apologies for this super delay! will get back to you by this weekend.

@jfktrey
Copy link
Contributor Author

jfktrey commented Apr 4, 2019

Hey @aquynh , just wanted to check back in here. I know it's a large merge. Let me know if there's anything you need from me.

@jfktrey
Copy link
Contributor Author

jfktrey commented Aug 13, 2019

Hi, just checking in - is there anything I need to change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants