Skip to content

Commit

Permalink
100% cosmetic rename
Browse files Browse the repository at this point in the history
[skip travis]
  • Loading branch information
Fish-Git committed Oct 21, 2020
1 parent abe92d7 commit 360156d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -6436,7 +6436,7 @@ static void chann_txf_ref( int acc, BYTE* maddr, size_t len, const char* locatio
OBTAIN_INTLOCK( NULL );
{
while (sysblk.syncing)
hthread_wait_condition( &sysblk.sync_bc_cond, &sysblk.intlock, location );
hthread_wait_condition( &sysblk.sync_done_cond, &sysblk.intlock, location );
TXF_MADDRL( 0, len, 0, NULL, acc, maddr );
}
RELEASE_INTLOCK( NULL );
Expand Down
4 changes: 2 additions & 2 deletions cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2551,8 +2551,8 @@ static void CPU_Wait( REGS* regs )
{
sysblk.sync_mask &= ~HOSTREGS->cpubit;
if (!sysblk.sync_mask)
signal_condition(&sysblk.sync_cond);
wait_condition (&sysblk.sync_bc_cond, &sysblk.intlock);
signal_condition(&sysblk.all_synced_cond);
wait_condition (&sysblk.sync_done_cond, &sysblk.intlock);
}

/*
Expand Down
24 changes: 17 additions & 7 deletions hinlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,15 @@ static inline void synchronize_cpus( REGS* regs, const char* location )
{
sysblk.sync_mask = mask;
sysblk.syncing = true;
sysblk.intowner = LOCK_OWNER_NONE;

hthread_wait_condition( &sysblk.sync_cond, &sysblk.intlock, location );

sysblk.intowner = LOCK_OWNER_NONE;
{
hthread_wait_condition( &sysblk.all_synced_cond, &sysblk.intlock, location );
}
sysblk.intowner = HOSTREGS->cpuad;
sysblk.syncing = false;

hthread_broadcast_condition( &sysblk.sync_bc_cond, location );
sysblk.syncing = false;
hthread_broadcast_condition( &sysblk.sync_done_cond, location );
}
/* All active processors other than self, are now waiting at their
* respective sync point. We may now safely proceed doing whatever
Expand Down Expand Up @@ -389,14 +390,23 @@ static inline void Interrupt_Lock_Obtained( REGS* regs, const char* location )
{
if (regs)
{
/* Wait for any SYNCHRONIZE_CPUS to finish before proceeding */
while (sysblk.syncing)
{
/* Indicate we have reached the sync point */
sysblk.sync_mask &= ~HOSTREGS->cpubit;

/* If we're the last CPU to reach this sync point,
signal the CPU that requested the sync that it
may now safely proceed with its exclusive logic.
*/
if (!sysblk.sync_mask)
hthread_signal_condition( &sysblk.sync_cond, location );
hthread_signal_condition( &sysblk.all_synced_cond, location );

hthread_wait_condition( &sysblk.sync_bc_cond, &sysblk.intlock, location );
/* Wait for CPU that requested the sync to indicate
it's done and thus is now safe for us to proceed.
*/
hthread_wait_condition( &sysblk.sync_done_cond, &sysblk.intlock, location );
}

HOSTREGS->intwait = false;
Expand Down
4 changes: 2 additions & 2 deletions hstructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,8 @@ struct SYSBLK {
/* Fields used by SYNCHRONIZE_CPUS */
bool syncing; /* 1=Sync in progress */
CPU_BITMAP sync_mask; /* CPU mask for syncing CPUs */
COND sync_cond; /* COND for syncing CPU */
COND sync_bc_cond; /* COND for other CPUs */
COND all_synced_cond; /* Sync in progress COND */
COND sync_done_cond; /* Synchronization done COND */

#if defined( OPTION_SHARED_DEVICES )
LOCK shrdlock; /* shrdport LOCK */
Expand Down
4 changes: 2 additions & 2 deletions impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ int rc;
#endif
}
}
initialize_condition( &sysblk.sync_cond );
initialize_condition( &sysblk.sync_bc_cond );
initialize_condition( &sysblk.all_synced_cond );
initialize_condition( &sysblk.sync_done_cond );

/* Copy length for regs */
sysblk.regs_copy_len = (int)((uintptr_t)&sysblk.dummyregs.regs_copy_end
Expand Down
2 changes: 1 addition & 1 deletion sie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ static int ARCH_DEP( run_sie )( REGS* regs )
timed_wait_condition( &regs->intcond, &sysblk.intlock, &waittime );

while (sysblk.syncing)
wait_condition( &sysblk.sync_bc_cond, &sysblk.intlock );
wait_condition( &sysblk.sync_done_cond, &sysblk.intlock );
}
sysblk.intowner = regs->cpuad;
sysblk.waiting_mask &= ~regs->cpubit;
Expand Down

0 comments on commit 360156d

Please sign in to comment.