-
Notifications
You must be signed in to change notification settings - Fork 11
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
Usefulness of xbra.h #39
Comments
|
I don't know where you see any self-modifying code, or where it stores d2/a2, but the TRAP_VEC macro really looks very suspicious. Do you know of any code that makes use of that header? |
There is a JMP/JSR instruction followed by an absolute address. If this structure happens to be a part of text segment (i.e.
That is why I write "if xbra_struct::this is a C function", every C function, should it use d2/a2, stores them because gcc uses only d0-d1/a0-a1 as scratch registers.
I don't. That is why I'm inclined to remove it before it makes further damage. :) |
While looking into https://github.com/freemint/mintlib/blob/master/include/mint/xbra.h I have found a couple of issues with it:
#define _TRAP_VEC(n,x) ((void (*) __P((void))) (((long) n << 24) | (long) &(x.jump)))
for -- it looks like it assumes that&(x.jump)
is located in ST-RAM (?) and creates some magic function pointer with maskingn
into bits 31-24._TRAP_INIT
?xbra_struct::this
is a C function, it unnecessarily stores d2/a2 (those are going to be stored by any TOS call inosbind.h
anyway)xbra_struct
(where the actual custom vector isn't anywhere near the 'XBRA' header) ?I'm tempted to propose removal of this file completely, unless somebody wants to rework it (at least that SMC code could have been reworked as inline assembly loading
this
into an address register & jump).The text was updated successfully, but these errors were encountered: