Skip to content

Commit

Permalink
i#5368: Replace disrespectful terms "master" and "slave" (#5378)
Browse files Browse the repository at this point in the history
i#5368: Replace disrespectful terms "master" and "slave"

Replaces "master" and "slave" with "main" (or "manager") and "worker"
respectively where possible. Also renames files containing these terms
with the corresponding inclusive terms.

Fixes #5368
  • Loading branch information
bete0 authored Feb 19, 2022
1 parent 427c4c5 commit 88525af
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 93 deletions.
8 changes: 4 additions & 4 deletions core/arch/aarch64/aarch64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,11 @@ GLOBAL_LABEL(dynamorio_sys_exit:)
# ifndef HAVE_SIGALTSTACK
# error NYI
# endif
DECLARE_FUNC(master_signal_handler)
GLOBAL_LABEL(master_signal_handler:)
DECLARE_FUNC(main_signal_handler)
GLOBAL_LABEL(main_signal_handler:)
mov ARG4, sp /* pass as extra arg */
b GLOBAL_REF(master_signal_handler_C) /* chain call */
END_FUNC(master_signal_handler)
b GLOBAL_REF(main_signal_handler_C) /* chain call */
END_FUNC(main_signal_handler)

# endif /* NOT_DYNAMORIO_CORE_PROPER */

Expand Down
12 changes: 6 additions & 6 deletions core/arch/arm/arm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ START_FILE

DECL_EXTERN(dynamorio_app_take_over_helper)
#if defined(UNIX)
DECL_EXTERN(master_signal_handler_C)
DECL_EXTERN(main_signal_handler_C)
DECL_EXTERN(dr_setjmp_sigmask)
#endif
DECL_EXTERN(relocate_dynamorio)
Expand Down Expand Up @@ -545,17 +545,17 @@ GLOBAL_LABEL(dynamorio_sys_exit:)
#ifndef HAVE_SIGALTSTACK
# error NYI
#endif
DECLARE_FUNC(master_signal_handler)
GLOBAL_LABEL(master_signal_handler:)
DECLARE_FUNC(main_signal_handler)
GLOBAL_LABEL(main_signal_handler:)
mov ARG4, sp /* pass as extra arg */
/* i#2107: we repeat the mov to work around odd behavior on Android
* where sometimes the kernel sends control to the 2nd instruction here.
*/
mov ARG4, sp /* pass as extra arg */
b GLOBAL_REF(master_signal_handler_C)
/* master_signal_handler_C will do the ret */
b GLOBAL_REF(main_signal_handler_C)
/* main_signal_handler_C will do the ret */
bl GLOBAL_REF(unexpected_return)
END_FUNC(master_signal_handler)
END_FUNC(main_signal_handler)

#endif /* LINUX */

Expand Down
2 changes: 1 addition & 1 deletion core/arch/x86/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void
d_r_logtrace(dcontext_t *dcontext, uint level, instrlist_t *trace, const char *string);

/****************************************************************************/
/* master routine */
/* main routine */

void
optimize_trace(dcontext_t *dcontext, app_pc tag, instrlist_t *trace)
Expand Down
28 changes: 14 additions & 14 deletions core/arch/x86/x86.asm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ DECL_EXTERN(internal_exception_info)
DECL_EXTERN(is_currently_on_dstack)
DECL_EXTERN(nt_continue_setup)
#if defined(UNIX)
DECL_EXTERN(master_signal_handler_C)
DECL_EXTERN(main_signal_handler_C)
#endif
#ifdef MACOS
DECL_EXTERN(new_bsdthread_setup)
Expand Down Expand Up @@ -1423,26 +1423,26 @@ GLOBAL_LABEL(dynamorio_nonrt_sigreturn:)
/* We used to get the SP by taking the address of our args, but that doesn't
* work on x64 nor with other compilers. Today we use asm to pass in the
* initial SP. For x64, we add a 4th register param and tail call to
* master_signal_handler_C. Adding a param and doing a tail call on ia32 is
* main_signal_handler_C. Adding a param and doing a tail call on ia32 is
* hard, so we make a real call and pass only xsp. The C routine uses it to
* read the original params.
* See also PR 305020.
*/
DECLARE_FUNC(master_signal_handler)
GLOBAL_LABEL(master_signal_handler:)
DECLARE_FUNC(main_signal_handler)
GLOBAL_LABEL(main_signal_handler:)
#ifdef X64
# ifdef LINUX
mov ARG4, REG_XSP /* pass as extra arg */
jmp GLOBAL_REF(master_signal_handler_C)
/* master_signal_handler_C will do the ret */
jmp GLOBAL_REF(main_signal_handler_C)
/* main_signal_handler_C will do the ret */
# else /* MACOS */
mov rax, REG_XSP /* save for extra arg */
push ARG2 /* infostyle */
push ARG5 /* ucxt */
push ARG6 /* token */
/* rsp is now aligned again */
mov ARG6, rax /* pass as extra arg */
CALLC0(GLOBAL_REF(master_signal_handler_C))
CALLC0(GLOBAL_REF(main_signal_handler_C))
/* Set up args to SYS_sigreturn */
pop ARG3 /* token */
pop ARG1 /* ucxt */
Expand All @@ -1455,7 +1455,7 @@ GLOBAL_LABEL(master_signal_handler:)
* intermediate frame.
*/
mov REG_XAX, REG_XSP
CALLC1_FRESH(GLOBAL_REF(master_signal_handler_C), REG_XAX)
CALLC1_FRESH(GLOBAL_REF(main_signal_handler_C), REG_XAX)
# ifdef MACOS
mov eax, ARG5 /* ucxt */
/* Set up args to SYS_sigreturn, skipping the retaddr slot */
Expand All @@ -1466,7 +1466,7 @@ GLOBAL_LABEL(master_signal_handler:)
ret
# endif
#endif
END_FUNC(master_signal_handler)
END_FUNC(main_signal_handler)

#else /* !HAVE_SIGALTSTACK */

Expand All @@ -1480,8 +1480,8 @@ GLOBAL_LABEL(master_signal_handler:)
* of a C routine: have to fix up locals + frame ptr, or jmp to start of
* func and clobber callee-saved regs (which messes up vmkernel sigreturn).
*/
DECLARE_FUNC(master_signal_handler)
GLOBAL_LABEL(master_signal_handler:)
DECLARE_FUNC(main_signal_handler)
GLOBAL_LABEL(main_signal_handler:)
mov REG_XAX, ARG1
mov REG_XCX, ARG2
mov REG_XDX, ARG3
Expand Down Expand Up @@ -1542,18 +1542,18 @@ no_swap:
pop ARG2
pop ARG1
mov rcx, rsp /* pass as 4th arg */
jmp GLOBAL_REF(master_signal_handler_C)
jmp GLOBAL_REF(main_signal_handler_C)
/* can't return, no retaddr */
# else
add REG_XSP, 3*ARG_SZ
/* We need to pass in xsp. The easiest way is to create an
* intermediate frame.
*/
mov REG_XAX, REG_XSP
CALLC1(GLOBAL_REF(master_signal_handler_C), REG_XAX)
CALLC1(GLOBAL_REF(main_signal_handler_C), REG_XAX)
ret
# endif
END_FUNC(master_signal_handler)
END_FUNC(main_signal_handler)
#endif /* !HAVE_SIGALTSTACK */

#ifdef LINUX
Expand Down
4 changes: 2 additions & 2 deletions core/fragment.c
Original file line number Diff line number Diff line change
Expand Up @@ -5668,7 +5668,7 @@ enter_nolinking(dcontext_t *dcontext, fragment_t *was_I_flushed, bool cache_tran

/* now we act on pending actions that can only be done while nolinking
* FIXME: optimization if add more triggers here: use a single
* master trigger as a first test to avoid testing all
* main trigger as a first test to avoid testing all
* conditionals every time
*/

Expand Down Expand Up @@ -5836,7 +5836,7 @@ increment_global_flushtime()
LOG(GLOBAL, LOG_VMAREAS, 2, "new flush timestamp: %u\n", flushtime_global);
}

/* The master flusher routines are split into 3:
/* The main flusher routines are split into 3:
* stage1) flush_fragments_synch_unlink_priv
* stage2) flush_fragments_unlink_shared
* stage3) flush_fragments_end_synch
Expand Down
2 changes: 1 addition & 1 deletion core/fragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ typedef struct _fragment_entry_t {
/* Flags stored in {fragment,ibl}_table_t->flags bitfield
*/
/* Indicates that fragment entries are shared between multiple tables in an
* inclusive hierarchical fashion, so only removal from the master table (which
* inclusive hierarchical fashion, so only removal from the main table (which
* is not so marked) will result in fragment deletion. Used primarily for
* IBL targeted tables
*/
Expand Down
2 changes: 1 addition & 1 deletion core/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define HASHTABLE_ENTRY_SHARED 0x00000002
/* Is the table accessed for reads concurrently without a lock? */
#define HASHTABLE_LOCKLESS_ACCESS 0x00000004
/* Is the table the primary, master list of its contents? */
/* Is the table the primary, main list of its contents? */
#define HASHTABLE_NOT_PRIMARY_STORAGE 0x00000004
/* Is the table allocated in persistent memory? */
#define HASHTABLE_PERSISTENT 0x00000008
Expand Down
4 changes: 2 additions & 2 deletions core/heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5152,7 +5152,7 @@ special_heap_init_internal(uint block_size, uint block_alignment, bool use_lock,

#if defined(WINDOWS_PC_SAMPLE) && !defined(DEBUG)
if (special_heap_profile_enabled()) {
/* Add to the global master list, which requires a lock */
/* Add to the global main list, which requires a lock */
d_r_mutex_lock(&special_units_list_lock);
su->next = special_units_list;
special_units_list = su;
Expand Down Expand Up @@ -5328,7 +5328,7 @@ special_heap_exit(void *special)
total_heap_used / 1024);
#if defined(WINDOWS_PC_SAMPLE) && !defined(DEBUG)
if (special_heap_profile_enabled()) {
/* Removed this special_units_t from the master list */
/* Removed this special_units_t from the main list */
d_r_mutex_lock(&special_units_list_lock);
if (special_units_list == su)
special_units_list = su->next;
Expand Down
2 changes: 1 addition & 1 deletion core/optionsx.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
}
/* FIXME: case 9014 reenabling more resets or maybe
* reset_at_vmm_threshold reset_at_commit_threshold shouldn't be
* disabled in DISABLE_RESET but left under the master option
* disabled in DISABLE_RESET but left under the main option
*/

#define DISABLE_TRACES(prefix) \
Expand Down
2 changes: 1 addition & 1 deletion core/synch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,7 @@ detach_on_permanent_stack(bool internal, bool do_cleanup, dr_stats_t *drstats)
dynamo_thread_exit_pre_client(my_dcontext, my_tr->id);
}

LOG(GLOBAL, LOG_ALL, 1, "Detach: Letting slave threads go native\n");
LOG(GLOBAL, LOG_ALL, 1, "Detach: Letting secondary threads go native\n");
#ifdef WINDOWS
global_heap_free(cleanup_tpc, num_threads * sizeof(bool) HEAPACCT(ACCT_OTHER));
/* XXX: there's a possible race if a thread waiting at APC is still there
Expand Down
Loading

0 comments on commit 88525af

Please sign in to comment.