diff options
Diffstat (limited to 'kernel/gsp_sema_service.c')
| -rw-r--r-- | kernel/gsp_sema_service.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 26d3b1a..603e9f0 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -20364,6 +20364,30 @@ static void svc_mme_sa_record(u32 slot, u32 entry) svc_mme_sa_present |= 1ull << slot; } +/* + * Golden SA completion (sema_gl_mme_sa_golden_fill): publish a slot's + * golden IR entry into the host-side START-ADDRESS RAM table when the + * client's own 0x11c/0x120 runs never supplied it (present bit clear, or + * present with entry 0 - the r1231 "SA[34]=0 lands last" shape). A + * nonzero client entry is never overwritten: the client's own upload is + * always the authority. The GR builder calls this before its per-launch + * SA re-arm and its stub/call-drop decisions, so a golden-served slot + * (e.g. DRAW_IAB slot 34 -> IR 0x265) resolves to the same IR offset the + * pack overlay wrote instead of jumping to macro 0. + */ +bool gsp_sema_mme_sa_fill(u32 slot, u32 entry) +{ + if (slot >= 64u) + return false; + if ((READ_ONCE(svc_mme_sa_present) & (1ull << slot)) && + svc_mme_sa_entry[slot]) + return false; + WRITE_ONCE(svc_mme_sa_entry[slot], entry); + WRITE_ONCE(svc_mme_sa_present, + READ_ONCE(svc_mme_sa_present) | (1ull << slot)); + return true; +} + static bool svc_mme_setup_run_addr(u32 addr) { return (addr >= 0x114u && addr <= 0x124u) || addr == 0x234u || |
