aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-02-12 04:14:11 -0500
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-06-16 07:47:36 -0400
commit6a89a9dba2bf16aac408fb7ba7ac548a02837464 (patch)
tree863db1118d70d9fb01d5f95f5177dae89b0bd1c8
parentde666cf0a6b5eb67be0bd518c959a9cf3336dd15 (diff)
cris/kgdb: Remove sections protected by #ifdef PROCESS_SUPPORT
When enabled, it doesn't build anyway: arch/cris/arch-v10/kernel/kgdb.c: In function 'copy_registers_from_stack': arch/cris/arch-v10/kernel/kgdb.c:631:2: error: unknown type name 'stack_registers' arch/cris/arch-v10/kernel/kgdb.c:631:24: error: 'stack_registers' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:631:24: note: each undeclared identifier is reported only once for each function it appears in arch/cris/arch-v10/kernel/kgdb.c:631:41: error: expected expression before ')' token arch/cris/arch-v10/kernel/kgdb.c:635:11: error: request for member 'r' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:636:29: error: 'stack_list' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:637:16: error: request for member 'pc' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:638:18: error: request for member 'dccr' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:639:17: error: request for member 'srp' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c: In function 'copy_registers_to_stack': arch/cris/arch-v10/kernel/kgdb.c:648:2: error: unknown type name 'stack_registers' arch/cris/arch-v10/kernel/kgdb.c:648:24: error: 'stack_registers' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:648:41: error: expected expression before ')' token arch/cris/arch-v10/kernel/kgdb.c:652:4: error: request for member 'r' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:654:3: error: request for member 'pc' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:655:3: error: request for member 'dccr' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:656:3: error: request for member 'srp' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c: In function 'write_stack_register': arch/cris/arch-v10/kernel/kgdb.c:702:2: error: unknown type name 'stack_registers' arch/cris/arch-v10/kernel/kgdb.c:702:24: error: 'stack_registers' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:702:41: error: expected expression before ')' token arch/cris/arch-v10/kernel/kgdb.c:707:4: error: request for member 'r' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:710:3: error: 'stack_list' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:713:4: error: request for member 'pc' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:716:4: error: request for member 'srp' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c:719:4: error: request for member 'dccr' in something not a structure or union arch/cris/arch-v10/kernel/kgdb.c: In function 'stub_is_stopped': arch/cris/arch-v10/kernel/kgdb.c:827:36: error: 'pos' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c: In function 'handle_exception': arch/cris/arch-v10/kernel/kgdb.c:1064:40: error: 'number_of_tasks' undeclared (first use in this function) arch/cris/arch-v10/kernel/kgdb.c:1125:8: error: implicit declaration of function 'os_is_started' [-Werror=implicit-function-declaration] Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r--arch/cris/arch-v10/kernel/kgdb.c257
1 files changed, 2 insertions, 255 deletions
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
index 0e799073498d..22d846bfc570 100644
--- a/arch/cris/arch-v10/kernel/kgdb.c
+++ b/arch/cris/arch-v10/kernel/kgdb.c
@@ -341,16 +341,6 @@ static int consistency_status = SUCCESS;
341 in order to provide access mainly for 'g', 'G' and 'P'. 341 in order to provide access mainly for 'g', 'G' and 'P'.
342*/ 342*/
343 343
344#ifdef PROCESS_SUPPORT
345/* Need two task id pointers in order to handle Hct and Hgt commands. */
346static int current_thread_c = 0;
347static int current_thread_g = 0;
348
349/* Need two register images in order to handle Hct and Hgt commands. The
350 variable reg_g is in addition to cris_reg above. */
351static registers reg_g;
352#endif /* PROCESS_SUPPORT */
353
354/********************************** Breakpoint *******************************/ 344/********************************** Breakpoint *******************************/
355/* Use an internal stack in the breakpoint and interrupt response routines */ 345/* Use an internal stack in the breakpoint and interrupt response routines */
356#define INTERNAL_STACK_SIZE 1024 346#define INTERNAL_STACK_SIZE 1024
@@ -608,55 +598,6 @@ putDebugString (const unsigned char *str, int length)
608} 598}
609 599
610/********************************* Register image ****************************/ 600/********************************* Register image ****************************/
611#ifdef PROCESS_SUPPORT
612/* Copy the content of a register image into another. The size n is
613 the size of the register image. Due to struct assignment generation of
614 memcpy in libc. */
615static void
616copy_registers (registers *dptr, registers *sptr, int n)
617{
618 unsigned char *dreg;
619 unsigned char *sreg;
620
621 for (dreg = (unsigned char*)dptr, sreg = (unsigned char*)sptr; n > 0; n--)
622 *dreg++ = *sreg++;
623}
624
625/* Copy the stored registers from the stack. Put the register contents
626 of thread thread_id in the struct reg. */
627static void
628copy_registers_from_stack (int thread_id, registers *regptr)
629{
630 int j;
631 stack_registers *s = (stack_registers *)stack_list[thread_id];
632 unsigned int *d = (unsigned int *)regptr;
633
634 for (j = 13; j >= 0; j--)
635 *d++ = s->r[j];
636 regptr->sp = (unsigned int)stack_list[thread_id];
637 regptr->pc = s->pc;
638 regptr->dccr = s->dccr;
639 regptr->srp = s->srp;
640}
641
642/* Copy the registers to the stack. Put the register contents of thread
643 thread_id from struct reg to the stack. */
644static void
645copy_registers_to_stack (int thread_id, registers *regptr)
646{
647 int i;
648 stack_registers *d = (stack_registers *)stack_list[thread_id];
649 unsigned int *s = (unsigned int *)regptr;
650
651 for (i = 0; i < 14; i++) {
652 d->r[i] = *s++;
653 }
654 d->pc = regptr->pc;
655 d->dccr = regptr->dccr;
656 d->srp = regptr->srp;
657}
658#endif
659
660/* Write a value to a specified register in the register image of the current 601/* Write a value to a specified register in the register image of the current
661 thread. Returns status code SUCCESS, E02 or E05. */ 602 thread. Returns status code SUCCESS, E02 or E05. */
662static int 603static int
@@ -692,40 +633,6 @@ write_register (int regno, char *val)
692 return status; 633 return status;
693} 634}
694 635
695#ifdef PROCESS_SUPPORT
696/* Write a value to a specified register in the stack of a thread other
697 than the current thread. Returns status code SUCCESS or E07. */
698static int
699write_stack_register (int thread_id, int regno, char *valptr)
700{
701 int status = SUCCESS;
702 stack_registers *d = (stack_registers *)stack_list[thread_id];
703 unsigned int val;
704
705 hex2mem ((unsigned char *)&val, valptr, sizeof(unsigned int));
706 if (regno >= R0 && regno < SP) {
707 d->r[regno] = val;
708 }
709 else if (regno == SP) {
710 stack_list[thread_id] = val;
711 }
712 else if (regno == PC) {
713 d->pc = val;
714 }
715 else if (regno == SRP) {
716 d->srp = val;
717 }
718 else if (regno == DCCR) {
719 d->dccr = val;
720 }
721 else {
722 /* Do not support registers in the current thread. */
723 status = E07;
724 }
725 return status;
726}
727#endif
728
729/* Read a value from a specified register in the register image. Returns the 636/* Read a value from a specified register in the register image. Returns the
730 value in the register or -1 for non-implemented registers. 637 value in the register or -1 for non-implemented registers.
731 Should check consistency_status after a call which may be E05 after changes 638 Should check consistency_status after a call which may be E05 after changes
@@ -811,26 +718,6 @@ stub_is_stopped(int sigval)
811 718
812 } 719 }
813 720
814#ifdef PROCESS_SUPPORT
815 /* Store the registers of the executing thread. Assume that both step,
816 continue, and register content requests are with respect to this
817 thread. The executing task is from the operating system scheduler. */
818
819 current_thread_c = executing_task;
820 current_thread_g = executing_task;
821
822 /* A struct assignment translates into a libc memcpy call. Avoid
823 all libc functions in order to prevent recursive break points. */
824 copy_registers (&reg_g, &cris_reg, sizeof(registers));
825
826 /* Store thread:r...; with the executing task TID. */
827 gdb_cris_strcpy (&remcomOutBuffer[pos], "thread:");
828 pos += gdb_cris_strlen ("thread:");
829 remcomOutBuffer[pos++] = hex_asc_hi(executing_task);
830 remcomOutBuffer[pos++] = hex_asc_lo(executing_task);
831 gdb_cris_strcpy (&remcomOutBuffer[pos], ";");
832#endif
833
834 /* null-terminate and send it off */ 721 /* null-terminate and send it off */
835 722
836 *ptr = 0; 723 *ptr = 0;
@@ -865,19 +752,7 @@ handle_exception (int sigval)
865 in a register are in the same order the machine uses. 752 in a register are in the same order the machine uses.
866 Failure: void. */ 753 Failure: void. */
867 754
868 { 755 mem2hex(remcomOutBuffer, (char *)&cris_reg, sizeof(registers));
869#ifdef PROCESS_SUPPORT
870 /* Use the special register content in the executing thread. */
871 copy_registers (&reg_g, &cris_reg, sizeof(registers));
872 /* Replace the content available on the stack. */
873 if (current_thread_g != executing_task) {
874 copy_registers_from_stack (current_thread_g, &reg_g);
875 }
876 mem2hex ((unsigned char *)remcomOutBuffer, (unsigned char *)&reg_g, sizeof(registers));
877#else
878 mem2hex(remcomOutBuffer, (char *)&cris_reg, sizeof(registers));
879#endif
880 }
881 break; 756 break;
882 757
883 case 'G': 758 case 'G':
@@ -885,17 +760,7 @@ handle_exception (int sigval)
885 Each byte of register data is described by two hex digits. 760 Each byte of register data is described by two hex digits.