Reinstall our attention vector patch on return from P8.
It was getting uninstalled when the ATalk driver was restarted at that time.
This commit is contained in:
parent
9ea3f1d2fb
commit
814158ab0e
59
afpbridge.c
59
afpbridge.c
|
@ -30,6 +30,7 @@ typedef struct VersionMessageRec {
|
||||||
extern Word *unloadFlagPtr;
|
extern Word *unloadFlagPtr;
|
||||||
extern void resetRoutine(void);
|
extern void resetRoutine(void);
|
||||||
|
|
||||||
|
void PatchAttentionVector(void);
|
||||||
void pollTask(void);
|
void pollTask(void);
|
||||||
void notificationProc(void);
|
void notificationProc(void);
|
||||||
static pascal Word requestProc(Word reqCode, Long dataIn, Long dataOut);
|
static pascal Word requestProc(Word reqCode, Long dataIn, Long dataOut);
|
||||||
|
@ -43,6 +44,9 @@ static struct RunQRec {
|
||||||
void (*proc)(void);
|
void (*proc)(void);
|
||||||
} runQRec;
|
} runQRec;
|
||||||
|
|
||||||
|
#define NOTIFY_SHUTDOWN 0x20
|
||||||
|
#define NOTIFY_GSOS_SWITCH 0x04
|
||||||
|
|
||||||
static struct NotificationProcRec {
|
static struct NotificationProcRec {
|
||||||
Long reserved1;
|
Long reserved1;
|
||||||
Word reserved2;
|
Word reserved2;
|
||||||
|
@ -70,7 +74,6 @@ int main(void) {
|
||||||
FSTInfoRecGS fstInfoRec;
|
FSTInfoRecGS fstInfoRec;
|
||||||
NotifyProcRecGS addNotifyProcRec;
|
NotifyProcRecGS addNotifyProcRec;
|
||||||
VersionMessageRec versionMessageRec;
|
VersionMessageRec versionMessageRec;
|
||||||
PFIHooksRec pfiHooksRec;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for presence of AppleShare FST. We error out and unload
|
* Check for presence of AppleShare FST. We error out and unload
|
||||||
|
@ -127,7 +130,7 @@ int main(void) {
|
||||||
AddToRunQ((Pointer)&runQRec);
|
AddToRunQ((Pointer)&runQRec);
|
||||||
|
|
||||||
notificationProcRec.Signature = 0xA55A;
|
notificationProcRec.Signature = 0xA55A;
|
||||||
notificationProcRec.Event_flags = 0x20; /* shutdown */
|
notificationProcRec.Event_flags = NOTIFY_SHUTDOWN | NOTIFY_GSOS_SWITCH;
|
||||||
notificationProcRec.jml = JML;
|
notificationProcRec.jml = JML;
|
||||||
notificationProcRec.proc = notificationProc;
|
notificationProcRec.proc = notificationProc;
|
||||||
addNotifyProcRec.pCount = 1;
|
addNotifyProcRec.pCount = 1;
|
||||||
|
@ -139,20 +142,7 @@ int main(void) {
|
||||||
oldSoftReset = *SoftResetPtr;
|
oldSoftReset = *SoftResetPtr;
|
||||||
*SoftResetPtr = ((LongWord)&resetRoutine << 8) | JML;
|
*SoftResetPtr = ((LongWord)&resetRoutine << 8) | JML;
|
||||||
|
|
||||||
/*
|
PatchAttentionVector();
|
||||||
* Install our own attention vector that bypasses the one in the
|
|
||||||
* ATalk driver in problematic cases (for session number > 8).
|
|
||||||
*/
|
|
||||||
pfiHooksRec.async = 0;
|
|
||||||
pfiHooksRec.command = pfiHooksCommand;
|
|
||||||
pfiHooksRec.hookFlag = 0; /* get GS/OS hooks */
|
|
||||||
_CALLAT(&pfiHooksRec);
|
|
||||||
if (pfiHooksRec.result == 0) {
|
|
||||||
jmlOldAttentionVec = (pfiHooksRec.attentionVector << 8) | JML;
|
|
||||||
pfiHooksRec.attentionVector = (LongWord)&attentionVec;
|
|
||||||
pfiHooksRec.hookFlag = pfiHooksSetHooks; /* set GS/OS hooks */
|
|
||||||
_CALLAT(&pfiHooksRec);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -161,6 +151,25 @@ error:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Install our own attention vector that bypasses the one in the
|
||||||
|
* ATalk driver in problematic cases (for session number > 8).
|
||||||
|
*/
|
||||||
|
void PatchAttentionVector(void) {
|
||||||
|
PFIHooksRec pfiHooksRec;
|
||||||
|
|
||||||
|
pfiHooksRec.async = 0;
|
||||||
|
pfiHooksRec.command = pfiHooksCommand;
|
||||||
|
pfiHooksRec.hookFlag = 0; /* get hooks */
|
||||||
|
_CALLAT(&pfiHooksRec);
|
||||||
|
if (pfiHooksRec.result == 0) {
|
||||||
|
jmlOldAttentionVec = (pfiHooksRec.attentionVector << 8) | JML;
|
||||||
|
pfiHooksRec.attentionVector = (LongWord)&attentionVec;
|
||||||
|
pfiHooksRec.hookFlag = pfiHooksSetHooks; /* set hooks, GS/OS mode */
|
||||||
|
_CALLAT(&pfiHooksRec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#pragma databank 1
|
#pragma databank 1
|
||||||
void pollTask(void) {
|
void pollTask(void) {
|
||||||
|
@ -180,10 +189,13 @@ void pollTask(void) {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notification procedure called at shutdown time.
|
* Notification procedure called at shutdown time or when switching to GS/OS.
|
||||||
* We try to notify the servers that we're closing the connections.
|
*
|
||||||
* This only works if Marinetti is still active, i.e. if its own
|
* We try to notify the servers that we're closing the connections at shutdown.
|
||||||
* shutdown notification procedure hasn't run yet.
|
* This only works if Marinetti is still active, i.e. if its own shutdown
|
||||||
|
* notification procedure hasn't run yet.
|
||||||
|
*
|
||||||
|
* When switching back from P8, we reinstall our attention vector patch.
|
||||||
*/
|
*/
|
||||||
#pragma databank 1
|
#pragma databank 1
|
||||||
void notificationProc(void) {
|
void notificationProc(void) {
|
||||||
|
@ -192,7 +204,12 @@ void notificationProc(void) {
|
||||||
IncBusyFlag();
|
IncBusyFlag();
|
||||||
stateReg = ForceRomIn();
|
stateReg = ForceRomIn();
|
||||||
|
|
||||||
CloseAllSessions(0, TRUE);
|
if (notificationProcRec.Event_code & NOTIFY_GSOS_SWITCH) {
|
||||||
|
PatchAttentionVector();
|
||||||
|
}
|
||||||
|
if (notificationProcRec.Event_code & NOTIFY_SHUTDOWN) {
|
||||||
|
CloseAllSessions(aspAttenClosed, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
RestoreStateReg(stateReg);
|
RestoreStateReg(stateReg);
|
||||||
DecBusyFlag();
|
DecBusyFlag();
|
||||||
|
|
Loading…
Reference in New Issue