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

Some calls to Event::Event ctor require a very particular load sequence from .data section #70

Open
robojumper opened this issue Oct 17, 2024 · 1 comment

Comments

@robojumper
Copy link
Collaborator

The ctor at 800a0c40 is sometimes called with a pattern like this:

// this works but I don't like it
static volatile u32 FLAGS_1 = 0x00000001;
static u32 FLAGS_2 = 0x00100001;
u32 f1 = FLAGS_1;
u32 f2 = FLAGS_2;
Event e = Event(mOffEventId, roomid, f2 & ~f1, nullptr, nullptr);
mEvent.scheduleEvent(e, 0);

Every call has its own copy of these statics even within the same file, and the volatile seems to be required to load them in the right order. This looks like an obvious hack but we haven't found a good way to match it...

@robojumper robojumper changed the title Some calls to Event::Event ctor requires very particular load sequence from .data section Some calls to Event::Event ctor require a very particular load sequence from .data section Oct 17, 2024
@elijah-thomas774
Copy link
Collaborator

Another thing to note:
0x00100001 is a common parameter to creating an event.
This usually is an immediate load, but in the cases of & ~f1 both become data. f1 is also consistently 0x00000001 in these cases

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

No branches or pull requests

2 participants