-/* Assuming usable watch registers, return the irw_mask. */
-
-static uint32_t
-get_irw_mask (struct pt_watch_regs *regs, int set)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- return regs->mips32.watch_masks[set] & IRW_MASK;
- case pt_watch_style_mips64:
- return regs->mips64.watch_masks[set] & IRW_MASK;
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, return the reg_mask. */
-
-static uint32_t
-get_reg_mask (struct pt_watch_regs *regs, int set)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- return regs->mips32.watch_masks[set] & ~IRW_MASK;
- case pt_watch_style_mips64:
- return regs->mips64.watch_masks[set] & ~IRW_MASK;
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, return the num_valid. */
-
-static uint32_t
-get_num_valid (struct pt_watch_regs *regs)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- return regs->mips32.num_valid;
- case pt_watch_style_mips64:
- return regs->mips64.num_valid;
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, return the watchlo. */
-
-static CORE_ADDR
-get_watchlo (struct pt_watch_regs *regs, int set)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- return regs->mips32.watchlo[set];
- case pt_watch_style_mips64:
- return regs->mips64.watchlo[set];
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, set a watchlo value. */
-
-static void
-set_watchlo (struct pt_watch_regs *regs, int set, CORE_ADDR value)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- /* The cast will never throw away bits as 64 bit addresses can
- never be used on a 32 bit kernel. */
- regs->mips32.watchlo[set] = (uint32_t)value;
- break;
- case pt_watch_style_mips64:
- regs->mips64.watchlo[set] = value;
- break;
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, return the watchhi. */
-
-static uint32_t
-get_watchhi (struct pt_watch_regs *regs, int n)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- return regs->mips32.watchhi[n];
- case pt_watch_style_mips64:
- return regs->mips64.watchhi[n];
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-
-/* Assuming usable watch registers, set a watchhi value. */
-
-static void
-set_watchhi (struct pt_watch_regs *regs, int n, uint16_t value)
-{
- switch (regs->style)
- {
- case pt_watch_style_mips32:
- regs->mips32.watchhi[n] = value;
- break;
- case pt_watch_style_mips64:
- regs->mips64.watchhi[n] = value;
- break;
- default:
- internal_error (__FILE__, __LINE__,
- _("Unrecognized watch register style"));
- }
-}
-