gdb/gdbserver/spu-low.c - gdb

Global variables defined

Functions defined

Macros defined

Source code

  1. /* Low level interface to SPUs, for the remote server for GDB.
  2.    Copyright (C) 2006-2015 Free Software Foundation, Inc.

  3.    Contributed by Ulrich Weigand <uweigand@de.ibm.com>.

  4.    This file is part of GDB.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. #include "server.h"

  16. #include "gdb_wait.h"
  17. #include <sys/ptrace.h>
  18. #include <fcntl.h>
  19. #include <unistd.h>
  20. #include <sys/syscall.h>
  21. #include "filestuff.h"
  22. #include "hostio.h"

  23. /* Some older glibc versions do not define this.  */
  24. #ifndef __WNOTHREAD
  25. #define __WNOTHREAD     0x20000000      /* Don't wait on children of other
  26.                                            threads in this group */
  27. #endif

  28. #define PTRACE_TYPE_RET long
  29. #define PTRACE_TYPE_ARG3 long

  30. /* Number of registers.  */
  31. #define SPU_NUM_REGS         130
  32. #define SPU_NUM_CORE_REGS    128

  33. /* Special registers.  */
  34. #define SPU_ID_REGNUM        128
  35. #define SPU_PC_REGNUM        129

  36. /* PPU side system calls.  */
  37. #define INSTR_SC        0x44000002
  38. #define NR_spu_run        0x0116

  39. /* These are used in remote-utils.c.  */
  40. int using_threads = 0;

  41. /* Defined in auto-generated file reg-spu.c.  */
  42. void init_registers_spu (void);
  43. extern const struct target_desc *tdesc_spu;

  44. /* Fetch PPU register REGNO.  */
  45. static CORE_ADDR
  46. fetch_ppc_register (int regno)
  47. {
  48.   PTRACE_TYPE_RET res;

  49.   int tid = ptid_get_lwp (current_ptid);

  50. #ifndef __powerpc64__
  51.   /* If running as a 32-bit process on a 64-bit system, we attempt
  52.      to get the full 64-bit register content of the target process.
  53.      If the PPC special ptrace call fails, we're on a 32-bit system;
  54.      just fall through to the regular ptrace call in that case.  */
  55.   {
  56.     char buf[8];

  57.     errno = 0;
  58.     ptrace (PPC_PTRACE_PEEKUSR_3264, tid,
  59.             (PTRACE_TYPE_ARG3) (regno * 8), buf);
  60.     if (errno == 0)
  61.       ptrace (PPC_PTRACE_PEEKUSR_3264, tid,
  62.               (PTRACE_TYPE_ARG3) (regno * 8 + 4), buf + 4);
  63.     if (errno == 0)
  64.       return (CORE_ADDR) *(unsigned long long *)buf;
  65.   }
  66. #endif

  67.   errno = 0;
  68.   res = ptrace (PT_READ_U, tid,
  69.                 (PTRACE_TYPE_ARG3) (regno * sizeof (PTRACE_TYPE_RET)), 0);
  70.   if (errno != 0)
  71.     {
  72.       char mess[128];
  73.       sprintf (mess, "reading PPC register #%d", regno);
  74.       perror_with_name (mess);
  75.     }

  76.   return (CORE_ADDR) (unsigned long) res;
  77. }

  78. /* Fetch WORD from PPU memory at (aligned) MEMADDR in thread TID.  */
  79. static int
  80. fetch_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET *word)
  81. {
  82.   errno = 0;

  83. #ifndef __powerpc64__
  84.   if (memaddr >> 32)
  85.     {
  86.       unsigned long long addr_8 = (unsigned long long) memaddr;
  87.       ptrace (PPC_PTRACE_PEEKTEXT_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
  88.     }
  89.   else
  90. #endif
  91.     *word = ptrace (PT_READ_I, tid, (PTRACE_TYPE_ARG3) (size_t) memaddr, 0);

  92.   return errno;
  93. }

  94. /* Store WORD into PPU memory at (aligned) MEMADDR in thread TID.  */
  95. static int
  96. store_ppc_memory_1 (int tid, CORE_ADDR memaddr, PTRACE_TYPE_RET word)
  97. {
  98.   errno = 0;

  99. #ifndef __powerpc64__
  100.   if (memaddr >> 32)
  101.     {
  102.       unsigned long long addr_8 = (unsigned long long) memaddr;
  103.       ptrace (PPC_PTRACE_POKEDATA_3264, tid, (PTRACE_TYPE_ARG3) &addr_8, word);
  104.     }
  105.   else
  106. #endif
  107.     ptrace (PT_WRITE_D, tid, (PTRACE_TYPE_ARG3) (size_t) memaddr, word);

  108.   return errno;
  109. }

  110. /* Fetch LEN bytes of PPU memory at MEMADDR to MYADDR.  */
  111. static int
  112. fetch_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len)
  113. {
  114.   int i, ret;

  115.   CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
  116.   int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
  117.                / sizeof (PTRACE_TYPE_RET));
  118.   PTRACE_TYPE_RET *buffer;

  119.   int tid = ptid_get_lwp (current_ptid);

  120.   buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));
  121.   for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
  122.     if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[i])) != 0)
  123.       return ret;

  124.   memcpy (myaddr,
  125.           (char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
  126.           len);

  127.   return 0;
  128. }

  129. /* Store LEN bytes from MYADDR to PPU memory at MEMADDR.  */
  130. static int
  131. store_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len)
  132. {
  133.   int i, ret;

  134.   CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_TYPE_RET);
  135.   int count = ((((memaddr + len) - addr) + sizeof (PTRACE_TYPE_RET) - 1)
  136.                / sizeof (PTRACE_TYPE_RET));
  137.   PTRACE_TYPE_RET *buffer;

  138.   int tid = ptid_get_lwp (current_ptid);

  139.   buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));

  140.   if (addr != memaddr || len < (int) sizeof (PTRACE_TYPE_RET))
  141.     if ((ret = fetch_ppc_memory_1 (tid, addr, &buffer[0])) != 0)
  142.       return ret;

  143.   if (count > 1)
  144.     if ((ret = fetch_ppc_memory_1 (tid, addr + (count - 1)
  145.                                                * sizeof (PTRACE_TYPE_RET),
  146.                                    &buffer[count - 1])) != 0)
  147.       return ret;

  148.   memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_TYPE_RET) - 1)),
  149.           myaddr, len);

  150.   for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
  151.     if ((ret = store_ppc_memory_1 (tid, addr, buffer[i])) != 0)
  152.       return ret;

  153.   return 0;
  154. }


  155. /* If the PPU thread is currently stopped on a spu_run system call,
  156.    return to FD and ADDR the file handle and NPC parameter address
  157.    used with the system call.  Return non-zero if successful.  */
  158. static int
  159. parse_spufs_run (int *fd, CORE_ADDR *addr)
  160. {
  161.   unsigned int insn;
  162.   CORE_ADDR pc = fetch_ppc_register (32);  /* nip */

  163.   /* Fetch instruction preceding current NIP.  */
  164.   if (fetch_ppc_memory (pc-4, (char *) &insn, 4) != 0)
  165.     return 0;
  166.   /* It should be a "sc" instruction.  */
  167.   if (insn != INSTR_SC)
  168.     return 0;
  169.   /* System call number should be NR_spu_run.  */
  170.   if (fetch_ppc_register (0) != NR_spu_run)
  171.     return 0;

  172.   /* Register 3 contains fd, register 4 the NPC param pointer.  */
  173.   *fd = fetch_ppc_register (34);  /* orig_gpr3 */
  174.   *addr = fetch_ppc_register (4);
  175.   return 1;
  176. }


  177. /* Copy LEN bytes at OFFSET in spufs file ANNEX into/from READBUF or WRITEBUF,
  178.    using the /proc file system.  */
  179. static int
  180. spu_proc_xfer_spu (const char *annex, unsigned char *readbuf,
  181.                    const unsigned char *writebuf,
  182.                    CORE_ADDR offset, int len)
  183. {
  184.   char buf[128];
  185.   int fd = 0;
  186.   int ret = -1;

  187.   if (!annex)
  188.     return 0;

  189.   sprintf (buf, "/proc/%ld/fd/%s", ptid_get_lwp (current_ptid), annex);
  190.   fd = open (buf, writebuf? O_WRONLY : O_RDONLY);
  191.   if (fd <= 0)
  192.     return -1;

  193.   if (offset != 0
  194.       && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
  195.     {
  196.       close (fd);
  197.       return 0;
  198.     }

  199.   if (writebuf)
  200.     ret = write (fd, writebuf, (size_t) len);
  201.   else if (readbuf)
  202.     ret = read (fd, readbuf, (size_t) len);

  203.   close (fd);
  204.   return ret;
  205. }


  206. /* Start an inferior process and returns its pid.
  207.    ALLARGS is a vector of program-name and args. */
  208. static int
  209. spu_create_inferior (char *program, char **allargs)
  210. {
  211.   int pid;
  212.   ptid_t ptid;
  213.   struct process_info *proc;

  214.   pid = fork ();
  215.   if (pid < 0)
  216.     perror_with_name ("fork");

  217.   if (pid == 0)
  218.     {
  219.       close_most_fds ();
  220.       ptrace (PTRACE_TRACEME, 0, 0, 0);

  221.       setpgid (0, 0);

  222.       execv (program, allargs);
  223.       if (errno == ENOENT)
  224.         execvp (program, allargs);

  225.       fprintf (stderr, "Cannot exec %s: %s.\n", program,
  226.                strerror (errno));
  227.       fflush (stderr);
  228.       _exit (0177);
  229.     }

  230.   proc = add_process (pid, 0);
  231.   proc->tdesc = tdesc_spu;

  232.   ptid = ptid_build (pid, pid, 0);
  233.   add_thread (ptid, NULL);
  234.   return pid;
  235. }

  236. /* Attach to an inferior process.  */
  237. int
  238. spu_attach (unsigned long  pid)
  239. {
  240.   ptid_t ptid;
  241.   struct process_info *proc;

  242.   if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0)
  243.     {
  244.       fprintf (stderr, "Cannot attach to process %ld: %s (%d)\n", pid,
  245.                strerror (errno), errno);
  246.       fflush (stderr);
  247.       _exit (0177);
  248.     }

  249.   proc = add_process (pid, 1);
  250.   proc->tdesc = tdesc_spu;
  251.   ptid = ptid_build (pid, pid, 0);
  252.   add_thread (ptid, NULL);
  253.   return 0;
  254. }

  255. /* Kill the inferior process.  */
  256. static int
  257. spu_kill (int pid)
  258. {
  259.   int status, ret;
  260.   struct process_info *process = find_process_pid (pid);
  261.   if (process == NULL)
  262.     return -1;

  263.   ptrace (PTRACE_KILL, pid, 0, 0);

  264.   do {
  265.     ret = waitpid (pid, &status, 0);
  266.     if (WIFEXITED (status) || WIFSIGNALED (status))
  267.       break;
  268.   } while (ret != -1 || errno != ECHILD);

  269.   clear_inferiors ();
  270.   remove_process (process);
  271.   return 0;
  272. }

  273. /* Detach from inferior process.  */
  274. static int
  275. spu_detach (int pid)
  276. {
  277.   struct process_info *process = find_process_pid (pid);
  278.   if (process == NULL)
  279.     return -1;

  280.   ptrace (PTRACE_DETACH, pid, 0, 0);

  281.   clear_inferiors ();
  282.   remove_process (process);
  283.   return 0;
  284. }

  285. static void
  286. spu_mourn (struct process_info *process)
  287. {
  288.   remove_process (process);
  289. }

  290. static void
  291. spu_join (int pid)
  292. {
  293.   int status, ret;

  294.   do {
  295.     ret = waitpid (pid, &status, 0);
  296.     if (WIFEXITED (status) || WIFSIGNALED (status))
  297.       break;
  298.   } while (ret != -1 || errno != ECHILD);
  299. }

  300. /* Return nonzero if the given thread is still alive.  */
  301. static int
  302. spu_thread_alive (ptid_t ptid)
  303. {
  304.   return ptid_equal (ptid, current_ptid);
  305. }

  306. /* Resume process.  */
  307. static void
  308. spu_resume (struct thread_resume *resume_info, size_t n)
  309. {
  310.   size_t i;

  311.   for (i = 0; i < n; i++)
  312.     if (ptid_equal (resume_info[i].thread, minus_one_ptid)
  313.         || ptid_equal (resume_info[i].thread, current_ptid))
  314.       break;

  315.   if (i == n)
  316.     return;

  317.   /* We don't support hardware single-stepping right now, assume
  318.      GDB knows to use software single-stepping.  */
  319.   if (resume_info[i].kind == resume_step)
  320.     fprintf (stderr, "Hardware single-step not supported.\n");

  321.   regcache_invalidate ();

  322.   errno = 0;
  323.   ptrace (PTRACE_CONT, ptid_get_lwp (current_ptid), 0, resume_info[i].sig);
  324.   if (errno)
  325.     perror_with_name ("ptrace");
  326. }

  327. /* Wait for process, returns status.  */
  328. static ptid_t
  329. spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options)
  330. {
  331.   int pid = ptid_get_pid (ptid);
  332.   int w;
  333.   int ret;

  334.   while (1)
  335.     {
  336.       ret = waitpid (pid, &w, WNOHANG | __WALL | __WNOTHREAD);

  337.       if (ret == -1)
  338.         {
  339.           if (errno != ECHILD)
  340.             perror_with_name ("waitpid");
  341.         }
  342.       else if (ret > 0)
  343.         break;

  344.       usleep (1000);
  345.     }

  346.   /* On the first wait, continue running the inferior until we are
  347.      blocked inside an spu_run system call.  */
  348.   if (!server_waiting)
  349.     {
  350.       int fd;
  351.       CORE_ADDR addr;

  352.       while (!parse_spufs_run (&fd, &addr))
  353.         {
  354.           ptrace (PT_SYSCALL, pid, (PTRACE_TYPE_ARG3) 0, 0);
  355.           waitpid (pid, NULL, __WALL | __WNOTHREAD);
  356.         }
  357.     }

  358.   if (WIFEXITED (w))
  359.     {
  360.       fprintf (stderr, "\nChild exited with retcode = %x \n", WEXITSTATUS (w));
  361.       ourstatus->kind =  TARGET_WAITKIND_EXITED;
  362.       ourstatus->value.integer = WEXITSTATUS (w);
  363.       clear_inferiors ();
  364.       return pid_to_ptid (ret);
  365.     }
  366.   else if (!WIFSTOPPED (w))
  367.     {
  368.       fprintf (stderr, "\nChild terminated with signal = %x \n", WTERMSIG (w));
  369.       ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
  370.       ourstatus->value.sig = gdb_signal_from_host (WTERMSIG (w));
  371.       clear_inferiors ();
  372.       return pid_to_ptid (ret);
  373.     }

  374.   /* After attach, we may have received a SIGSTOP.  Do not return this
  375.      as signal to GDB, or else it will try to continue with SIGSTOP ...  */
  376.   if (!server_waiting)
  377.     {
  378.       ourstatus->kind = TARGET_WAITKIND_STOPPED;
  379.       ourstatus->value.sig = GDB_SIGNAL_0;
  380.       return ptid_build (ret, ret, 0);
  381.     }

  382.   ourstatus->kind = TARGET_WAITKIND_STOPPED;
  383.   ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w));
  384.   return ptid_build (ret, ret, 0);
  385. }

  386. /* Fetch inferior registers.  */
  387. static void
  388. spu_fetch_registers (struct regcache *regcache, int regno)
  389. {
  390.   int fd;
  391.   CORE_ADDR addr;

  392.   /* We must be stopped on a spu_run system call.  */
  393.   if (!parse_spufs_run (&fd, &addr))
  394.     return;

  395.   /* The ID register holds the spufs file handle.  */
  396.   if (regno == -1 || regno == SPU_ID_REGNUM)
  397.     supply_register (regcache, SPU_ID_REGNUM, (char *)&fd);

  398.   /* The NPC register is found at ADDR.  */
  399.   if (regno == -1 || regno == SPU_PC_REGNUM)
  400.     {
  401.       char buf[4];
  402.       if (fetch_ppc_memory (addr, buf, 4) == 0)
  403.         supply_register (regcache, SPU_PC_REGNUM, buf);
  404.     }

  405.   /* The GPRs are found in the "regs" spufs file.  */
  406.   if (regno == -1 || (regno >= 0 && regno < SPU_NUM_CORE_REGS))
  407.     {
  408.       unsigned char buf[16*SPU_NUM_CORE_REGS];
  409.       char annex[32];
  410.       int i;

  411.       sprintf (annex, "%d/regs", fd);
  412.       if (spu_proc_xfer_spu (annex, buf, NULL, 0, sizeof buf) == sizeof buf)
  413.         for (i = 0; i < SPU_NUM_CORE_REGS; i++)
  414.           supply_register (regcache, i, buf + i*16);
  415.     }
  416. }

  417. /* Store inferior registers.  */
  418. static void
  419. spu_store_registers (struct regcache *regcache, int regno)
  420. {
  421.   int fd;
  422.   CORE_ADDR addr;

  423.   /* ??? Some callers use 0 to mean all registers.  */
  424.   if (regno == 0)
  425.     regno = -1;

  426.   /* We must be stopped on a spu_run system call.  */
  427.   if (!parse_spufs_run (&fd, &addr))
  428.     return;

  429.   /* The NPC register is found at ADDR.  */
  430.   if (regno == -1 || regno == SPU_PC_REGNUM)
  431.     {
  432.       char buf[4];
  433.       collect_register (regcache, SPU_PC_REGNUM, buf);
  434.       store_ppc_memory (addr, buf, 4);
  435.     }

  436.   /* The GPRs are found in the "regs" spufs file.  */
  437.   if (regno == -1 || (regno >= 0 && regno < SPU_NUM_CORE_REGS))
  438.     {
  439.       unsigned char buf[16*SPU_NUM_CORE_REGS];
  440.       char annex[32];
  441.       int i;

  442.       for (i = 0; i < SPU_NUM_CORE_REGS; i++)
  443.         collect_register (regcache, i, buf + i*16);

  444.       sprintf (annex, "%d/regs", fd);
  445.       spu_proc_xfer_spu (annex, NULL, buf, 0, sizeof buf);
  446.     }
  447. }

  448. /* Copy LEN bytes from inferior's memory starting at MEMADDR
  449.    to debugger memory starting at MYADDR.  */
  450. static int
  451. spu_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
  452. {
  453.   int fd, ret;
  454.   CORE_ADDR addr;
  455.   char annex[32], lslr_annex[32], buf[32];
  456.   CORE_ADDR lslr;

  457.   /* We must be stopped on a spu_run system call.  */
  458.   if (!parse_spufs_run (&fd, &addr))
  459.     return 0;

  460.   /* Use the "mem" spufs file to access SPU local store.  */
  461.   sprintf (annex, "%d/mem", fd);
  462.   ret = spu_proc_xfer_spu (annex, myaddr, NULL, memaddr, len);
  463.   if (ret > 0)
  464.     return ret == len ? 0 : EIO;

  465.   /* SPU local store access wraps the address around at the
  466.      local store limit.  We emulate this here.  To avoid needing
  467.      an extra access to retrieve the LSLR, we only do that after
  468.      trying the original address first, and getting end-of-file.  */
  469.   sprintf (lslr_annex, "%d/lslr", fd);
  470.   memset (buf, 0, sizeof buf);
  471.   if (spu_proc_xfer_spu (lslr_annex, (unsigned char *)buf, NULL,
  472.                          0, sizeof buf) <= 0)
  473.     return ret;

  474.   lslr = strtoul (buf, NULL, 16);
  475.   ret = spu_proc_xfer_spu (annex, myaddr, NULL, memaddr & lslr, len);

  476.   return ret == len ? 0 : EIO;
  477. }

  478. /* Copy LEN bytes of data from debugger memory at MYADDR
  479.    to inferior's memory at MEMADDR.
  480.    On failure (cannot write the inferior)
  481.    returns the value of errno.  */
  482. static int
  483. spu_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
  484. {
  485.   int fd, ret;
  486.   CORE_ADDR addr;
  487.   char annex[32], lslr_annex[32], buf[32];
  488.   CORE_ADDR lslr;

  489.   /* We must be stopped on a spu_run system call.  */
  490.   if (!parse_spufs_run (&fd, &addr))
  491.     return 0;

  492.   /* Use the "mem" spufs file to access SPU local store.  */
  493.   sprintf (annex, "%d/mem", fd);
  494.   ret = spu_proc_xfer_spu (annex, NULL, myaddr, memaddr, len);
  495.   if (ret > 0)
  496.     return ret == len ? 0 : EIO;

  497.   /* SPU local store access wraps the address around at the
  498.      local store limit.  We emulate this here.  To avoid needing
  499.      an extra access to retrieve the LSLR, we only do that after
  500.      trying the original address first, and getting end-of-file.  */
  501.   sprintf (lslr_annex, "%d/lslr", fd);
  502.   memset (buf, 0, sizeof buf);
  503.   if (spu_proc_xfer_spu (lslr_annex, (unsigned char *)buf, NULL,
  504.                          0, sizeof buf) <= 0)
  505.     return ret;

  506.   lslr = strtoul (buf, NULL, 16);
  507.   ret = spu_proc_xfer_spu (annex, NULL, myaddr, memaddr & lslr, len);

  508.   return ret == len ? 0 : EIO;
  509. }

  510. /* Look up special symbols -- unneded here.  */
  511. static void
  512. spu_look_up_symbols (void)
  513. {
  514. }

  515. /* Send signal to inferior.  */
  516. static void
  517. spu_request_interrupt (void)
  518. {
  519.   syscall (SYS_tkill, ptid_get_lwp (current_ptid), SIGINT);
  520. }

  521. static struct target_ops spu_target_ops = {
  522.   spu_create_inferior,
  523.   spu_attach,
  524.   spu_kill,
  525.   spu_detach,
  526.   spu_mourn,
  527.   spu_join,
  528.   spu_thread_alive,
  529.   spu_resume,
  530.   spu_wait,
  531.   spu_fetch_registers,
  532.   spu_store_registers,
  533.   NULL, /* prepare_to_access_memory */
  534.   NULL, /* done_accessing_memory */
  535.   spu_read_memory,
  536.   spu_write_memory,
  537.   spu_look_up_symbols,
  538.   spu_request_interrupt,
  539.   NULL,
  540.   NULL/* supports_z_point_type */
  541.   NULL,
  542.   NULL,
  543.   NULL,
  544.   NULL,
  545.   NULL,
  546.   NULL,
  547.   spu_proc_xfer_spu,
  548.   hostio_last_error_from_errno,
  549. };

  550. void
  551. initialize_low (void)
  552. {
  553.   static const unsigned char breakpoint[] = { 0x00, 0x00, 0x3f, 0xff };

  554.   set_target_ops (&spu_target_ops);
  555.   set_breakpoint_data (breakpoint, sizeof breakpoint);
  556.   init_registers_spu ();
  557. }