diff options
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/Kconfig | 32 | ||||
-rw-r--r-- | arch/cris/arch-v10/kernel/kgdb.c | 870 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/Kconfig | 7 | ||||
-rw-r--r-- | arch/cris/include/asm/Kbuild | 4 | ||||
-rw-r--r-- | arch/cris/include/asm/io.h | 3 | ||||
-rw-r--r-- | arch/cris/include/asm/linkage.h | 6 |
6 files changed, 274 insertions, 648 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index 8769a9045a54..9f3c54360e78 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -637,40 +637,10 @@ endchoice | |||
637 | 637 | ||
638 | endmenu | 638 | endmenu |
639 | 639 | ||
640 | source "drivers/base/Kconfig" | 640 | source "drivers/Kconfig" |
641 | |||
642 | # standard linux drivers | ||
643 | source "drivers/mtd/Kconfig" | ||
644 | |||
645 | source "drivers/parport/Kconfig" | ||
646 | |||
647 | source "drivers/pnp/Kconfig" | ||
648 | |||
649 | source "drivers/block/Kconfig" | ||
650 | |||
651 | source "drivers/ide/Kconfig" | ||
652 | |||
653 | source "drivers/net/Kconfig" | ||
654 | |||
655 | source "drivers/i2c/Kconfig" | ||
656 | |||
657 | source "drivers/rtc/Kconfig" | ||
658 | |||
659 | # | ||
660 | # input before char - char/joystick depends on it. As does USB. | ||
661 | # | ||
662 | source "drivers/input/Kconfig" | ||
663 | |||
664 | source "drivers/char/Kconfig" | ||
665 | 641 | ||
666 | source "fs/Kconfig" | 642 | source "fs/Kconfig" |
667 | 643 | ||
668 | source "drivers/usb/Kconfig" | ||
669 | |||
670 | source "drivers/uwb/Kconfig" | ||
671 | |||
672 | source "drivers/staging/Kconfig" | ||
673 | |||
674 | source "arch/cris/Kconfig.debug" | 644 | source "arch/cris/Kconfig.debug" |
675 | 645 | ||
676 | source "security/Kconfig" | 646 | source "security/Kconfig" |
diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c index 37e6d2c50b76..22d846bfc570 100644 --- a/arch/cris/arch-v10/kernel/kgdb.c +++ b/arch/cris/arch-v10/kernel/kgdb.c | |||
@@ -230,46 +230,6 @@ struct register_image | |||
230 | unsigned int usp; /* 0x66 User mode stack pointer */ | 230 | unsigned int usp; /* 0x66 User mode stack pointer */ |
231 | } registers; | 231 | } registers; |
232 | 232 | ||
233 | /************** Prototypes for local library functions ***********************/ | ||
234 | |||
235 | /* Copy of strcpy from libc. */ | ||
236 | static char *gdb_cris_strcpy (char *s1, const char *s2); | ||
237 | |||
238 | /* Copy of strlen from libc. */ | ||
239 | static int gdb_cris_strlen (const char *s); | ||
240 | |||
241 | /* Copy of memchr from libc. */ | ||
242 | static void *gdb_cris_memchr (const void *s, int c, int n); | ||
243 | |||
244 | /* Copy of strtol from libc. Does only support base 16. */ | ||
245 | static int gdb_cris_strtol (const char *s, char **endptr, int base); | ||
246 | |||
247 | /********************** Prototypes for local functions. **********************/ | ||
248 | /* Copy the content of a register image into another. The size n is | ||
249 | the size of the register image. Due to struct assignment generation of | ||
250 | memcpy in libc. */ | ||
251 | static void copy_registers (registers *dptr, registers *sptr, int n); | ||
252 | |||
253 | /* Copy the stored registers from the stack. Put the register contents | ||
254 | of thread thread_id in the struct reg. */ | ||
255 | static void copy_registers_from_stack (int thread_id, registers *reg); | ||
256 | |||
257 | /* Copy the registers to the stack. Put the register contents of thread | ||
258 | thread_id from struct reg to the stack. */ | ||
259 | static void copy_registers_to_stack (int thread_id, registers *reg); | ||
260 | |||
261 | /* Write a value to a specified register regno in the register image | ||
262 | of the current thread. */ | ||
263 | static int write_register (int regno, char *val); | ||
264 | |||
265 | /* Write a value to a specified register in the stack of a thread other | ||
266 | than the current thread. */ | ||
267 | static int write_stack_register(int thread_id, int regno, char *valptr); | ||
268 | |||
269 | /* Read a value from a specified register in the register image. Returns the | ||
270 | status of the read operation. The register value is returned in valptr. */ | ||
271 | static int read_register (char regno, unsigned int *valptr); | ||
272 | |||
273 | /* Serial port, reads one character. ETRAX 100 specific. from debugport.c */ | 233 | /* Serial port, reads one character. ETRAX 100 specific. from debugport.c */ |
274 | int getDebugChar (void); | 234 | int getDebugChar (void); |
275 | 235 | ||
@@ -278,42 +238,6 @@ void putDebugChar (int val); | |||
278 | 238 | ||
279 | void enableDebugIRQ (void); | 239 | void enableDebugIRQ (void); |
280 | 240 | ||
281 | /* Returns the integer equivalent of a hexadecimal character. */ | ||
282 | static int hex (char ch); | ||
283 | |||
284 | /* Convert the memory, pointed to by mem into hexadecimal representation. | ||
285 | Put the result in buf, and return a pointer to the last character | ||
286 | in buf (null). */ | ||
287 | static char *mem2hex (char *buf, unsigned char *mem, int count); | ||
288 | |||
289 | /* Convert the array, in hexadecimal representation, pointed to by buf into | ||
290 | binary representation. Put the result in mem, and return a pointer to | ||
291 | the character after the last byte written. */ | ||
292 | static unsigned char *hex2mem (unsigned char *mem, char *buf, int count); | ||
293 | |||
294 | /* Put the content of the array, in binary representation, pointed to by buf | ||
295 | into memory pointed to by mem, and return a pointer to | ||
296 | the character after the last byte written. */ | ||
297 | static unsigned char *bin2mem (unsigned char *mem, unsigned char *buf, int count); | ||
298 | |||
299 | /* Await the sequence $<data>#<checksum> and store <data> in the array buffer | ||
300 | returned. */ | ||
301 | static void getpacket (char *buffer); | ||
302 | |||
303 | /* Send $<data>#<checksum> from the <data> in the array buffer. */ | ||
304 | static void putpacket (char *buffer); | ||
305 | |||
306 | /* Build and send a response packet in order to inform the host the | ||
307 | stub is stopped. */ | ||
308 | static void stub_is_stopped (int sigval); | ||
309 | |||
310 | /* All expected commands are sent from remote.c. Send a response according | ||
311 | to the description in remote.c. */ | ||
312 | static void handle_exception (int sigval); | ||
313 | |||
314 | /* Performs a complete re-start from scratch. ETRAX specific. */ | ||
315 | static void kill_restart (void); | ||
316 | |||
317 | /******************** Prototypes for global functions. ***********************/ | 241 | /******************** Prototypes for global functions. ***********************/ |
318 | 242 | ||
319 | /* The string str is prepended with the GDB printout token and sent. */ | 243 | /* The string str is prepended with the GDB printout token and sent. */ |
@@ -336,10 +260,6 @@ extern unsigned char executing_task; | |||
336 | /* The number of characters used for a 64 bit thread identifier. */ | 260 | /* The number of characters used for a 64 bit thread identifier. */ |
337 | #define HEXCHARS_IN_THREAD_ID 16 | 261 | #define HEXCHARS_IN_THREAD_ID 16 |
338 | 262 | ||
339 | /* Avoid warning as the internal_stack is not used in the C-code. */ | ||
340 | #define USEDVAR(name) { if (name) { ; } } | ||
341 | #define USEDFUN(name) { void (*pf)(void) = (void *)name; USEDVAR(pf) } | ||
342 | |||
343 | /********************************** Packet I/O ******************************/ | 263 | /********************************** Packet I/O ******************************/ |
344 | /* BUFMAX defines the maximum number of characters in | 264 | /* BUFMAX defines the maximum number of characters in |
345 | inbound/outbound buffers */ | 265 | inbound/outbound buffers */ |
@@ -405,7 +325,7 @@ static int register_size[] = | |||
405 | 325 | ||
406 | /* Contains the register image of the executing thread in the assembler | 326 | /* Contains the register image of the executing thread in the assembler |
407 | part of the code in order to avoid horrible addressing modes. */ | 327 | part of the code in order to avoid horrible addressing modes. */ |
408 | static registers reg; | 328 | registers cris_reg; |
409 | 329 | ||
410 | /* FIXME: Should this be used? Delete otherwise. */ | 330 | /* FIXME: Should this be used? Delete otherwise. */ |
411 | /* Contains the assumed consistency state of the register image. Uses the | 331 | /* Contains the assumed consistency state of the register image. Uses the |
@@ -413,7 +333,7 @@ static registers reg; | |||
413 | static int consistency_status = SUCCESS; | 333 | static int consistency_status = SUCCESS; |
414 | 334 | ||
415 | /********************************** Handle exceptions ************************/ | 335 | /********************************** Handle exceptions ************************/ |
416 | /* The variable reg contains the register image associated with the | 336 | /* The variable cris_reg contains the register image associated with the |
417 | current_thread_c variable. It is a complete register image created at | 337 | current_thread_c variable. It is a complete register image created at |
418 | entry. The reg_g contains a register image of a task where the general | 338 | entry. The reg_g contains a register image of a task where the general |
419 | registers are taken from the stack and all special registers are taken | 339 | registers are taken from the stack and all special registers are taken |
@@ -421,18 +341,10 @@ static int consistency_status = SUCCESS; | |||
421 | in order to provide access mainly for 'g', 'G' and 'P'. | 341 | in order to provide access mainly for 'g', 'G' and 'P'. |
422 | */ | 342 | */ |
423 | 343 | ||
424 | /* Need two task id pointers in order to handle Hct and Hgt commands. */ | ||
425 | static int current_thread_c = 0; | ||
426 | static int current_thread_g = 0; | ||
427 | |||
428 | /* Need two register images in order to handle Hct and Hgt commands. The | ||
429 | variable reg_g is in addition to reg above. */ | ||
430 | static registers reg_g; | ||
431 | |||
432 | /********************************** Breakpoint *******************************/ | 344 | /********************************** Breakpoint *******************************/ |
433 | /* Use an internal stack in the breakpoint and interrupt response routines */ | 345 | /* Use an internal stack in the breakpoint and interrupt response routines */ |
434 | #define INTERNAL_STACK_SIZE 1024 | 346 | #define INTERNAL_STACK_SIZE 1024 |
435 | static char internal_stack[INTERNAL_STACK_SIZE]; | 347 | char internal_stack[INTERNAL_STACK_SIZE]; |
436 | 348 | ||
437 | /* Due to the breakpoint return pointer, a state variable is needed to keep | 349 | /* Due to the breakpoint return pointer, a state variable is needed to keep |
438 | track of whether it is a static (compiled) or dynamic (gdb-invoked) | 350 | track of whether it is a static (compiled) or dynamic (gdb-invoked) |
@@ -500,164 +412,6 @@ gdb_cris_strtol (const char *s, char **endptr, int base) | |||
500 | return x; | 412 | return x; |
501 | } | 413 | } |
502 | 414 | ||
503 | /********************************* Register image ****************************/ | ||
504 | /* Copy the content of a register image into another. The size n is | ||
505 | the size of the register image. Due to struct assignment generation of | ||
506 | memcpy in libc. */ | ||
507 | static void | ||
508 | copy_registers (registers *dptr, registers *sptr, int n) | ||
509 | { | ||
510 | unsigned char *dreg; | ||
511 | unsigned char *sreg; | ||
512 | |||
513 | for (dreg = (unsigned char*)dptr, sreg = (unsigned char*)sptr; n > 0; n--) | ||
514 | *dreg++ = *sreg++; | ||
515 | } | ||
516 | |||
517 | #ifdef PROCESS_SUPPORT | ||
518 | /* Copy the stored registers from the stack. Put the register contents | ||
519 | of thread thread_id in the struct reg. */ | ||
520 | static void | ||
521 | copy_registers_from_stack (int thread_id, registers *regptr) | ||
522 | { | ||
523 | int j; | ||
524 | stack_registers *s = (stack_registers *)stack_list[thread_id]; | ||
525 | unsigned int *d = (unsigned int *)regptr; | ||
526 | |||
527 | for (j = 13; j >= 0; j--) | ||
528 | *d++ = s->r[j]; | ||
529 | regptr->sp = (unsigned int)stack_list[thread_id]; | ||
530 | regptr->pc = s->pc; | ||
531 | regptr->dccr = s->dccr; | ||
532 | regptr->srp = s->srp; | ||
533 | } | ||
534 | |||
535 | /* Copy the registers to the stack. Put the register contents of thread | ||
536 | thread_id from struct reg to the stack. */ | ||
537 | static void | ||
538 | copy_registers_to_stack (int thread_id, registers *regptr) | ||
539 | { | ||
540 | int i; | ||
541 | stack_registers *d = (stack_registers *)stack_list[thread_id]; | ||
542 | unsigned int *s = (unsigned int *)regptr; | ||
543 | |||
544 | for (i = 0; i < 14; i++) { | ||
545 | d->r[i] = *s++; | ||
546 | } | ||
547 | d->pc = regptr->pc; | ||
548 | d->dccr = regptr->dccr; | ||
549 | d->srp = regptr->srp; | ||
550 | } | ||
551 | #endif | ||
552 | |||
553 | /* Write a value to a specified register in the register image of the current | ||
554 | thread. Returns status code SUCCESS, E02 or E05. */ | ||
555 | static int | ||
556 | write_register (int regno, char *val) | ||
557 | { | ||
558 | int status = SUCCESS; | ||
559 | registers *current_reg = ® | ||
560 | |||
561 | if (regno >= R0 && regno <= PC) { | ||
562 | /* 32-bit register with simple offset. */ | ||
563 | hex2mem ((unsigned char *)current_reg + regno * sizeof(unsigned int), | ||
564 | val, sizeof(unsigned int)); | ||
565 | } | ||
566 | else if (regno == P0 || regno == VR || regno == P4 || regno == P8) { | ||
567 | /* Do not support read-only registers. */ | ||
568 | status = E02; | ||
569 | } | ||
570 | else if (regno == CCR) { | ||
571 | /* 16 bit register with complex offset. (P4 is read-only, P6 is not implemented, | ||
572 | and P7 (MOF) is 32 bits in ETRAX 100LX. */ | ||
573 | hex2mem ((unsigned char *)&(current_reg->ccr) + (regno-CCR) * sizeof(unsigned short), | ||
574 | val, sizeof(unsigned short)); | ||
575 | } | ||
576 | else if (regno >= MOF && regno <= USP) { | ||
577 | /* 32 bit register with complex offset. (P8 has been taken care of.) */ | ||
578 | hex2mem ((unsigned char *)&(current_reg->ibr) + (regno-IBR) * sizeof(unsigned int), | ||
579 | val, sizeof(unsigned int)); | ||
580 | } | ||
581 | else { | ||
582 | /* Do not support nonexisting or unimplemented registers (P2, P3, and P6). */ | ||
583 | status = E05; | ||
584 | } | ||
585 | return status; | ||
586 | } | ||
587 | |||
588 | #ifdef PROCESS_SUPPORT | ||
589 | /* Write a value to a specified register in the stack of a thread other | ||
590 | than the current thread. Returns status code SUCCESS or E07. */ | ||
591 | static int | ||
592 | write_stack_register (int thread_id, int regno, char *valptr) | ||
593 | { | ||
594 | int status = SUCCESS; | ||
595 | stack_registers *d = (stack_registers *)stack_list[thread_id]; | ||
596 | unsigned int val; | ||
597 | |||
598 | hex2mem ((unsigned char *)&val, valptr, sizeof(unsigned int)); | ||
599 | if (regno >= R0 && regno < SP) { | ||
600 | d->r[regno] = val; | ||
601 | } | ||
602 | else if (regno == SP) { | ||
603 | stack_list[thread_id] = val; | ||
604 | } | ||
605 | else if (regno == PC) { | ||
606 | d->pc = val; | ||
607 | } | ||
608 | else if (regno == SRP) { | ||
609 | d->srp = val; | ||
610 | } | ||
611 | else if (regno == DCCR) { | ||
612 | d->dccr = val; | ||
613 | } | ||
614 | else { | ||
615 | /* Do not support registers in the current thread. */ | ||
616 | status = E07; | ||
617 | } | ||
618 | return status; | ||
619 | } | ||
620 | #endif | ||
621 | |||
622 | /* Read a value from a specified register in the register image. Returns the | ||
623 | value in the register or -1 for non-implemented registers. | ||
624 | Should check consistency_status after a call which may be E05 after changes | ||
625 | in the implementation. */ | ||
626 | static int | ||
627 | read_register (char regno, unsigned int *valptr) | ||
628 | { | ||
629 | registers *current_reg = ® | ||
630 | |||
631 | if (regno >= R0 && regno <= PC) { | ||
632 | /* 32-bit register with simple offset. */ | ||
633 | *valptr = *(unsigned int *)((char *)current_reg + regno * sizeof(unsigned int)); | ||
634 | return SUCCESS; | ||
635 | } | ||
636 | else if (regno == P0 || regno == VR) { | ||
637 | /* 8 bit register with complex offset. */ | ||
638 | *valptr = (unsigned int)(*(unsigned char *) | ||
639 | ((char *)&(current_reg->p0) + (regno-P0) * sizeof(char))); | ||
640 | return SUCCESS; | ||
641 | } | ||
642 | else if (regno == P4 || regno == CCR) { | ||
643 | /* 16 bit register with complex offset. */ | ||
644 | *valptr = (unsigned int)(*(unsigned short *) | ||
645 | ((char *)&(current_reg->p4) + (regno-P4) * sizeof(unsigned short))); | ||
646 | return SUCCESS; | ||
647 | } | ||
648 | else if (regno >= MOF && regno <= USP) { | ||
649 | /* 32 bit register with complex offset. */ | ||
650 | *valptr = *(unsigned int *)((char *)&(current_reg->p8) | ||
651 | + (regno-P8) * sizeof(unsigned int)); | ||
652 | return SUCCESS; | ||
653 | } | ||
654 | else { | ||
655 | /* Do not support nonexisting or unimplemented registers (P2, P3, and P6). */ | ||
656 | consistency_status = E05; | ||
657 | return E05; | ||
658 | } | ||
659 | } | ||
660 | |||
661 | /********************************** Packet I/O ******************************/ | 415 | /********************************** Packet I/O ******************************/ |
662 | /* Returns the integer equivalent of a hexadecimal character. */ | 416 | /* Returns the integer equivalent of a hexadecimal character. */ |
663 | static int | 417 | static int |
@@ -676,8 +430,6 @@ hex (char ch) | |||
676 | Put the result in buf, and return a pointer to the last character | 430 | Put the result in buf, and return a pointer to the last character |
677 | in buf (null). */ | 431 | in buf (null). */ |
678 | 432 | ||
679 | static int do_printk = 0; | ||
680 | |||
681 | static char * | 433 | static char * |
682 | mem2hex(char *buf, unsigned char *mem, int count) | 434 | mem2hex(char *buf, unsigned char *mem, int count) |
683 | { | 435 | { |
@@ -761,7 +513,7 @@ getpacket (char *buffer) | |||
761 | xmitcsum = -1; | 513 | xmitcsum = -1; |
762 | count = 0; | 514 | count = 0; |
763 | /* Read until a # or the end of the buffer is reached */ | 515 | /* Read until a # or the end of the buffer is reached */ |
764 | while (count < BUFMAX) { | 516 | while (count < BUFMAX - 1) { |
765 | ch = getDebugChar (); | 517 | ch = getDebugChar (); |
766 | if (ch == '#') | 518 | if (ch == '#') |
767 | break; | 519 | break; |
@@ -845,6 +597,81 @@ putDebugString (const unsigned char *str, int length) | |||
845 | putpacket(remcomOutBuffer); | 597 | putpacket(remcomOutBuffer); |
846 | } | 598 | } |
847 | 599 | ||
600 | /********************************* Register image ****************************/ | ||
601 | /* Write a value to a specified register in the register image of the current | ||
602 | thread. Returns status code SUCCESS, E02 or E05. */ | ||
603 | static int | ||
604 | write_register (int regno, char *val) | ||
605 | { | ||
606 | int status = SUCCESS; | ||
607 | registers *current_reg = &cris_reg; | ||
608 | |||
609 | if (regno >= R0 && regno <= PC) { | ||
610 | /* 32-bit register with simple offset. */ | ||
611 | hex2mem ((unsigned char *)current_reg + regno * sizeof(unsigned int), | ||
612 | val, sizeof(unsigned int)); | ||
613 | } | ||
614 | else if (regno == P0 || regno == VR || regno == P4 || regno == P8) { | ||
615 | /* Do not support read-only registers. */ | ||
616 | status = E02; | ||
617 | } | ||
618 | else if (regno == CCR) { | ||
619 | /* 16 bit register with complex offset. (P4 is read-only, P6 is not implemented, | ||
620 | and P7 (MOF) is 32 bits in ETRAX 100LX. */ | ||
621 | hex2mem ((unsigned char *)&(current_reg->ccr) + (regno-CCR) * sizeof(unsigned short), | ||
622 | val, sizeof(unsigned short)); | ||
623 | } | ||
624 | else if (regno >= MOF && regno <= USP) { | ||
625 | /* 32 bit register with complex offset. (P8 has been taken care of.) */ | ||
626 | hex2mem ((unsigned char *)&(current_reg->ibr) + (regno-IBR) * sizeof(unsigned int), | ||
627 | val, sizeof(unsigned int)); | ||
628 | } | ||
629 | else { | ||
630 | /* Do not support nonexisting or unimplemented registers (P2, P3, and P6). */ | ||
631 | status = E05; | ||
632 | } | ||
633 | return status; | ||
634 | } | ||
635 | |||
636 | /* Read a value from a specified register in the register image. Returns the | ||
637 | value in the register or -1 for non-implemented registers. | ||
638 | Should check consistency_status after a call which may be E05 after changes | ||
639 | in the implementation. */ | ||
640 | static int | ||
641 | read_register (char regno, unsigned int *valptr) | ||
642 | { | ||
643 | registers *current_reg = &cris_reg; | ||
644 | |||
645 | if (regno >= R0 && regno <= PC) { | ||
646 | /* 32-bit register with simple offset. */ | ||
647 | *valptr = *(unsigned int *)((char *)current_reg + regno * sizeof(unsigned int)); | ||
648 | return SUCCESS; | ||
649 | } | ||
650 | else if (regno == P0 || regno == VR) { | ||
651 | /* 8 bit register with complex offset. */ | ||
652 | *valptr = (unsigned int)(*(unsigned char *) | ||
653 | ((char *)&(current_reg->p0) + (regno-P0) * sizeof(char))); | ||
654 | return SUCCESS; | ||
655 | } | ||
656 | else if (regno == P4 || regno == CCR) { | ||
657 | /* 16 bit register with complex offset. */ | ||
658 | *valptr = (unsigned int)(*(unsigned short *) | ||
659 | ((char *)&(current_reg->p4) + (regno-P4) * sizeof(unsigned short))); | ||
660 | return SUCCESS; | ||
661 | } | ||
662 | else if (regno >= MOF && regno <= USP) { | ||
663 | /* 32 bit register with complex offset. */ | ||
664 | *valptr = *(unsigned int *)((char *)&(current_reg->p8) | ||
665 | + (regno-P8) * sizeof(unsigned int)); | ||
666 | return SUCCESS; | ||
667 | } | ||
668 | else { | ||
669 | /* Do not support nonexisting or unimplemented registers (P2, P3, and P6). */ | ||
670 | consistency_status = E05; | ||
671 | return E05; | ||
672 | } | ||
673 | } | ||
674 | |||
848 | /********************************** Handle exceptions ************************/ | 675 | /********************************** Handle exceptions ************************/ |
849 | /* Build and send a response packet in order to inform the host the | 676 | /* Build and send a response packet in order to inform the host the |
850 | stub is stopped. TAAn...:r...;n...:r...;n...:r...; | 677 | stub is stopped. TAAn...:r...;n...:r...;n...:r...; |
@@ -891,26 +718,6 @@ stub_is_stopped(int sigval) | |||
891 | 718 | ||
892 | } | 719 | } |
893 | 720 | ||
894 | #ifdef PROCESS_SUPPORT | ||
895 | /* Store the registers of the executing thread. Assume that both step, | ||
896 | continue, and register content requests are with respect to this | ||
897 | thread. The executing task is from the operating system scheduler. */ | ||
898 | |||
899 | current_thread_c = executing_task; | ||
900 | current_thread_g = executing_task; | ||
901 | |||
902 | /* A struct assignment translates into a libc memcpy call. Avoid | ||
903 | all libc functions in order to prevent recursive break points. */ | ||
904 | copy_registers (®_g, ®, sizeof(registers)); | ||
905 | |||
906 | /* Store thread:r...; with the executing task TID. */ | ||
907 | gdb_cris_strcpy (&remcomOutBuffer[pos], "thread:"); | ||
908 | pos += gdb_cris_strlen ("thread:"); | ||
909 | remcomOutBuffer[pos++] = hex_asc_hi(executing_task); | ||
910 | remcomOutBuffer[pos++] = hex_asc_lo(executing_task); | ||
911 | gdb_cris_strcpy (&remcomOutBuffer[pos], ";"); | ||
912 | #endif | ||
913 | |||
914 | /* null-terminate and send it off */ | 721 | /* null-terminate and send it off */ |
915 | 722 | ||
916 | *ptr = 0; | 723 | *ptr = 0; |
@@ -918,16 +725,18 @@ stub_is_stopped(int sigval) | |||
918 | putpacket (remcomOutBuffer); | 725 | putpacket (remcomOutBuffer); |
919 | } | 726 | } |
920 | 727 | ||
728 | /* Performs a complete re-start from scratch. */ | ||
729 | static void | ||
730 | kill_restart (void) | ||
731 | { | ||
732 | machine_restart(""); | ||
733 | } | ||
734 | |||
921 | /* All expected commands are sent from remote.c. Send a response according | 735 | /* All expected commands are sent from remote.c. Send a response according |
922 | to the description in remote.c. */ | 736 | to the description in remote.c. */ |
923 | static void | 737 | void |
924 | handle_exception (int sigval) | 738 | handle_exception (int sigval) |
925 | { | 739 | { |
926 | /* Avoid warning of not used. */ | ||
927 | |||
928 | USEDFUN(handle_exception); | ||
929 | USEDVAR(internal_stack[0]); | ||
930 | |||
931 | /* Send response. */ | 740 | /* Send response. */ |
932 | 741 | ||
933 | stub_is_stopped (sigval); | 742 | stub_is_stopped (sigval); |
@@ -943,19 +752,7 @@ handle_exception (int sigval) | |||
943 | in a register are in the same order the machine uses. | 752 | in a register are in the same order the machine uses. |
944 | Failure: void. */ | 753 | Failure: void. */ |
945 | 754 | ||
946 | { | 755 | mem2hex(remcomOutBuffer, (char *)&cris_reg, sizeof(registers)); |
947 | #ifdef PROCESS_SUPPORT | ||
948 | /* Use the special register content in the executing thread. */ | ||
949 | copy_registers (®_g, ®, sizeof(registers)); | ||
950 | /* Replace the content available on the stack. */ | ||
951 | if (current_thread_g != executing_task) { | ||
952 | copy_registers_from_stack (current_thread_g, ®_g); | ||
953 | } | ||
954 | mem2hex ((unsigned char *)remcomOutBuffer, (unsigned char *)®_g, sizeof(registers)); | ||
955 | #else | ||
956 | mem2hex(remcomOutBuffer, (char *)®, sizeof(registers)); | ||
957 | #endif | ||
958 | } | ||
959 | break; | 756 | break; |
960 | 757 | ||
961 | case 'G': | 758 | case 'G': |
@@ -963,17 +760,7 @@ handle_exception (int sigval) | |||
963 | Each byte of register data is described by two hex digits. | 760 | Each byte of register data is described by two hex digits. |
964 | Success: OK | 761 | Success: OK |
965 | Failure: void. */ | 762 | Failure: void. */ |
966 | #ifdef PROCESS_SUPPORT | 763 | hex2mem((char *)&cris_reg, &remcomInBuffer[1], sizeof(registers)); |
967 | hex2mem ((unsigned char *)®_g, &remcomInBuffer[1], sizeof(registers)); | ||
968 | if (current_thread_g == executing_task) { | ||
969 | copy_registers (®, ®_g, sizeof(registers)); | ||
970 | } | ||
971 | else { | ||
972 | copy_registers_to_stack(current_thread_g, ®_g); | ||
973 | } | ||
974 | #else | ||
975 | hex2mem((char *)®, &remcomInBuffer[1], sizeof(registers)); | ||
976 | #endif | ||
977 | gdb_cris_strcpy (remcomOutBuffer, "OK"); | 764 | gdb_cris_strcpy (remcomOutBuffer, "OK"); |
978 | break; | 765 | break; |
979 | 766 | ||
@@ -989,12 +776,7 @@ handle_exception (int sigval) | |||
989 | char *suffix; | 776 | char *suffix; |
990 | int regno = gdb_cris_strtol (&remcomInBuffer[1], &suffix, 16); | 777 | int regno = gdb_cris_strtol (&remcomInBuffer[1], &suffix, 16); |
991 | int status; | 778 | int status; |
992 | #ifdef PROCESS_SUPPORT | 779 | status = write_register (regno, suffix+1); |
993 | if (current_thread_g != executing_task) | ||
994 | status = write_stack_register (current_thread_g, regno, suffix+1); | ||
995 | else | ||
996 | #endif | ||
997 | status = write_register (regno, suffix+1); | ||
998 | 780 | ||
999 | switch (status) { | 781 | switch (status) { |
1000 | case E02: | 782 | case E02: |
@@ -1073,7 +855,7 @@ handle_exception (int sigval) | |||
1073 | Success: return to the executing thread. | 855 | Success: return to the executing thread. |
1074 | Failure: will never know. */ | 856 | Failure: will never know. */ |
1075 | if (remcomInBuffer[1] != '\0') { | 857 | if (remcomInBuffer[1] != '\0') { |
1076 | reg.pc = gdb_cris_strtol (&remcomInBuffer[1], 0, 16); | 858 | cris_reg.pc = gdb_cris_strtol (&remcomInBuffer[1], 0, 16); |
1077 | } | 859 | } |
1078 | enableDebugIRQ(); | 860 | enableDebugIRQ(); |
1079 | return; | 861 | return; |
@@ -1129,119 +911,6 @@ handle_exception (int sigval) | |||
1129 | Not supported: E04 */ | 911 | Not supported: E04 */ |
1130 | gdb_cris_strcpy (remcomOutBuffer, error_message[E04]); | 912 | gdb_cris_strcpy (remcomOutBuffer, error_message[E04]); |
1131 | break; | 913 | break; |
1132 | #ifdef PROCESS_SUPPORT | ||
1133 | |||
1134 | case 'T': | ||
1135 | /* Thread alive. TXX | ||
1136 | Is thread XX alive? | ||
1137 | Success: OK, thread XX is alive. | ||
1138 | Failure: E03, thread XX is dead. */ | ||
1139 | { | ||
1140 | int thread_id = (int)gdb_cris_strtol (&remcomInBuffer[1], 0, 16); | ||
1141 | /* Cannot tell whether it is alive or not. */ | ||
1142 | if (thread_id >= 0 && thread_id < number_of_tasks) | ||
1143 | gdb_cris_strcpy (remcomOutBuffer, "OK"); | ||
1144 | } | ||
1145 | break; | ||
1146 | |||
1147 | case 'H': | ||
1148 | /* Set thread for subsequent operations: Hct | ||
1149 | c = 'c' for thread used in step and continue; | ||
1150 | t can be -1 for all threads. | ||
1151 | c = 'g' for thread used in other operations. | ||
1152 | t = 0 means pick any thread. | ||
1153 | Success: OK | ||
1154 | Failure: E01 */ | ||
1155 | { | ||
1156 | int thread_id = gdb_cris_strtol (&remcomInBuffer[2], 0, 16); | ||
1157 | if (remcomInBuffer[1] == 'c') { | ||
1158 | /* c = 'c' for thread used in step and continue */ | ||
1159 | /* Do not change current_thread_c here. It would create a mess in | ||
1160 | the scheduler. */ | ||
1161 | gdb_cris_strcpy (remcomOutBuffer, "OK"); | ||
1162 | } | ||
1163 | else if (remcomInBuffer[1] == 'g') { | ||
1164 | /* c = 'g' for thread used in other operations. | ||
1165 | t = 0 means pick any thread. Impossible since the scheduler does | ||
1166 | not allow that. */ | ||
1167 | if (thread_id >= 0 && thread_id < number_of_tasks) { | ||
1168 | current_thread_g = thread_id; | ||
1169 | gdb_cris_strcpy (remcomOutBuffer, "OK"); | ||
1170 | } | ||
1171 | else { | ||
1172 | /* Not expected - send an error message. */ | ||
1173 | gdb_cris_strcpy (remcomOutBuffer, error_message[E01]); | ||
1174 | } | ||
1175 | } | ||
1176 | else { | ||
1177 | /* Not expected - send an error message. */ | ||
1178 | gdb_cris_strcpy (remcomOutBuffer, error_message[E01]); | ||
1179 | } | ||
1180 | } | ||
1181 | break; | ||
1182 | |||
1183 | case 'q': | ||
1184 | case 'Q': | ||
1185 | /* Query of general interest. qXXXX | ||
1186 | Set general value XXXX. QXXXX=yyyy */ | ||
1187 | { | ||
1188 | int pos; | ||
1189 | int nextpos; | ||
1190 | int thread_id; | ||
1191 | |||
1192 | switch (remcomInBuffer[1]) { | ||
1193 | case 'C': | ||
1194 | /* Identify the remote current thread. */ | ||
1195 | gdb_cris_strcpy (&remcomOutBuffer[0], "QC"); | ||
1196 | remcomOutBuffer[2] = hex_asc_hi(current_thread_c); | ||
1197 | remcomOutBuffer[3] = hex_asc_lo(current_thread_c); | ||
1198 | remcomOutBuffer[4] = '\0'; | ||
1199 | break; | ||
1200 | case 'L': | ||
1201 | gdb_cris_strcpy (&remcomOutBuffer[0], "QM"); | ||
1202 | /* Reply with number of threads. */ | ||
1203 | if (os_is_started()) { | ||
1204 | remcomOutBuffer[2] = hex_asc_hi(number_of_tasks); | ||
1205 | remcomOutBuffer[3] = hex_asc_lo(number_of_tasks); | ||
1206 | } | ||
1207 | else { | ||
1208 | remcomOutBuffer[2] = hex_asc_hi(0); | ||
1209 | remcomOutBuffer[3] = hex_asc_lo(1); | ||
1210 | } | ||
1211 | /* Done with the reply. */ | ||
1212 | remcomOutBuffer[4] = hex_asc_lo(1); | ||
1213 | pos = 5; | ||
1214 | /* Expects the argument thread id. */ | ||
1215 | for (; pos < (5 + HEXCHARS_IN_THREAD_ID); pos++) | ||
1216 | remcomOutBuffer[pos] = remcomInBuffer[pos]; | ||
1217 | /* Reply with the thread identifiers. */ | ||
1218 | if (os_is_started()) { | ||
1219 | /* Store the thread identifiers of all tasks. */ | ||
1220 | for (thread_id = 0; thread_id < number_of_tasks; thread_id++) { | ||
1221 | nextpos = pos + HEXCHARS_IN_THREAD_ID - 1; | ||
1222 | for (; pos < nextpos; pos ++) | ||
1223 | remcomOutBuffer[pos] = hex_asc_lo(0); | ||
1224 | remcomOutBuffer[pos++] = hex_asc_lo(thread_id); | ||
1225 | } | ||
1226 | } | ||
1227 | else { | ||
1228 | /* Store the thread identifier of the boot task. */ | ||
1229 | nextpos = pos + HEXCHARS_IN_THREAD_ID - 1; | ||
1230 | for (; pos < nextpos; pos ++) | ||
1231 | remcomOutBuffer[pos] = hex_asc_lo(0); | ||
1232 | remcomOutBuffer[pos++] = hex_asc_lo(current_thread_c); | ||
1233 | } | ||
1234 | remcomOutBuffer[pos] = '\0'; | ||
1235 | break; | ||
1236 | default: | ||
1237 | /* Not supported: "" */ | ||
1238 | /* Request information about section offsets: qOffsets. */ | ||
1239 | remcomOutBuffer[0] = 0; | ||
1240 | break; | ||
1241 | } | ||
1242 | } | ||
1243 | break; | ||
1244 | #endif /* PROCESS_SUPPORT */ | ||
1245 | 914 | ||
1246 | default: | 915 | default: |
1247 | /* The stub should ignore other request and send an empty | 916 | /* The stub should ignore other request and send an empty |
@@ -1254,13 +923,6 @@ handle_exception (int sigval) | |||
1254 | } | 923 | } |
1255 | } | 924 | } |
1256 | 925 | ||
1257 | /* Performs a complete re-start from scratch. */ | ||
1258 | static void | ||
1259 | kill_restart () | ||
1260 | { | ||
1261 | machine_restart(""); | ||
1262 | } | ||
1263 | |||
1264 | /********************************** Breakpoint *******************************/ | 926 | /********************************** Breakpoint *******************************/ |
1265 | /* The hook for both a static (compiled) and a dynamic breakpoint set by GDB. | 927 | /* The hook for both a static (compiled) and a dynamic breakpoint set by GDB. |
1266 | An internal stack is used by the stub. The register image of the caller is | 928 | An internal stack is used by the stub. The register image of the caller is |
@@ -1270,93 +932,93 @@ kill_restart () | |||
1270 | 932 | ||
1271 | void kgdb_handle_breakpoint(void); | 933 | void kgdb_handle_breakpoint(void); |
1272 | 934 | ||
1273 | asm (" | 935 | asm ("\n" |
1274 | .global kgdb_handle_breakpoint | 936 | " .global kgdb_handle_breakpoint\n" |
1275 | kgdb_handle_breakpoint: | 937 | "kgdb_handle_breakpoint:\n" |
1276 | ;; | 938 | ";;\n" |
1277 | ;; Response to the break-instruction | 939 | ";; Response to the break-instruction\n" |
1278 | ;; | 940 | ";;\n" |
1279 | ;; Create a register image of the caller | 941 | ";; Create a register image of the caller\n" |
1280 | ;; | 942 | ";;\n" |
1281 | move $dccr,[reg+0x5E] ; Save the flags in DCCR before disable interrupts | 943 | " move $dccr,[cris_reg+0x5E] ; Save the flags in DCCR before disable interrupts\n" |
1282 | di ; Disable interrupts | 944 | " di ; Disable interrupts\n" |
1283 | move.d $r0,[reg] ; Save R0 | 945 | " move.d $r0,[cris_reg] ; Save R0\n" |
1284 | move.d $r1,[reg+0x04] ; Save R1 | 946 | " move.d $r1,[cris_reg+0x04] ; Save R1\n" |
1285 | move.d $r2,[reg+0x08] ; Save R2 | 947 | " move.d $r2,[cris_reg+0x08] ; Save R2\n" |
1286 | move.d $r3,[reg+0x0C] ; Save R3 | 948 | " move.d $r3,[cris_reg+0x0C] ; Save R3\n" |
1287 | move.d $r4,[reg+0x10] ; Save R4 | 949 | " move.d $r4,[cris_reg+0x10] ; Save R4\n" |
1288 | move.d $r5,[reg+0x14] ; Save R5 | 950 | " move.d $r5,[cris_reg+0x14] ; Save R5\n" |
1289 | move.d $r6,[reg+0x18] ; Save R6 | 951 | " move.d $r6,[cris_reg+0x18] ; Save R6\n" |
1290 | move.d $r7,[reg+0x1C] ; Save R7 | 952 | " move.d $r7,[cris_reg+0x1C] ; Save R7\n" |
1291 | move.d $r8,[reg+0x20] ; Save R8 | 953 | " move.d $r8,[cris_reg+0x20] ; Save R8\n" |
1292 | move.d $r9,[reg+0x24] ; Save R9 | 954 | " move.d $r9,[cris_reg+0x24] ; Save R9\n" |
1293 | move.d $r10,[reg+0x28] ; Save R10 | 955 | " move.d $r10,[cris_reg+0x28] ; Save R10\n" |
1294 | move.d $r11,[reg+0x2C] ; Save R11 | 956 | " move.d $r11,[cris_reg+0x2C] ; Save R11\n" |
1295 | move.d $r12,[reg+0x30] ; Save R12 | 957 | " move.d $r12,[cris_reg+0x30] ; Save R12\n" |
1296 | move.d $r13,[reg+0x34] ; Save R13 | 958 | " move.d $r13,[cris_reg+0x34] ; Save R13\n" |
1297 | move.d $sp,[reg+0x38] ; Save SP (R14) | 959 | " move.d $sp,[cris_reg+0x38] ; Save SP (R14)\n" |
1298 | ;; Due to the old assembler-versions BRP might not be recognized | 960 | ";; Due to the old assembler-versions BRP might not be recognized\n" |
1299 | .word 0xE670 ; move brp,$r0 | 961 | " .word 0xE670 ; move brp,$r0\n" |
1300 | subq 2,$r0 ; Set to address of previous instruction. | 962 | " subq 2,$r0 ; Set to address of previous instruction.\n" |
1301 | move.d $r0,[reg+0x3c] ; Save the address in PC (R15) | 963 | " move.d $r0,[cris_reg+0x3c] ; Save the address in PC (R15)\n" |
1302 | clear.b [reg+0x40] ; Clear P0 | 964 | " clear.b [cris_reg+0x40] ; Clear P0\n" |
1303 | move $vr,[reg+0x41] ; Save special register P1 | 965 | " move $vr,[cris_reg+0x41] ; Save special register P1\n" |
1304 | clear.w [reg+0x42] ; Clear P4 | 966 | " clear.w [cris_reg+0x42] ; Clear P4\n" |
1305 | move $ccr,[reg+0x44] ; Save special register CCR | 967 | " move $ccr,[cris_reg+0x44] ; Save special register CCR\n" |
1306 | move $mof,[reg+0x46] ; P7 | 968 | " move $mof,[cris_reg+0x46] ; P7\n" |
1307 | clear.d [reg+0x4A] ; Clear P8 | 969 | " clear.d [cris_reg+0x4A] ; Clear P8\n" |
1308 | move $ibr,[reg+0x4E] ; P9, | 970 | " move $ibr,[cris_reg+0x4E] ; P9,\n" |
1309 | move $irp,[reg+0x52] ; P10, | 971 | " move $irp,[cris_reg+0x52] ; P10,\n" |
1310 | move $srp,[reg+0x56] ; P11, | 972 | " move $srp,[cris_reg+0x56] ; P11,\n" |
1311 | move $dtp0,[reg+0x5A] ; P12, register BAR, assembler might not know BAR | 973 | " move $dtp0,[cris_reg+0x5A] ; P12, register BAR, assembler might not know BAR\n" |
1312 | ; P13, register DCCR already saved | 974 | " ; P13, register DCCR already saved\n" |
1313 | ;; Due to the old assembler-versions BRP might not be recognized | 975 | ";; Due to the old assembler-versions BRP might not be recognized\n" |
1314 | .word 0xE670 ; move brp,r0 | 976 | " .word 0xE670 ; move brp,r0\n" |
1315 | ;; Static (compiled) breakpoints must return to the next instruction in order | 977 | ";; Static (compiled) breakpoints must return to the next instruction in order\n" |
1316 | ;; to avoid infinite loops. Dynamic (gdb-invoked) must restore the instruction | 978 | ";; to avoid infinite loops. Dynamic (gdb-invoked) must restore the instruction\n" |
1317 | ;; in order to execute it when execution is continued. | 979 | ";; in order to execute it when execution is continued.\n" |
1318 | test.b [is_dyn_brkp] ; Is this a dynamic breakpoint? | 980 | " test.b [is_dyn_brkp] ; Is this a dynamic breakpoint?\n" |
1319 | beq is_static ; No, a static breakpoint | 981 | " beq is_static ; No, a static breakpoint\n" |
1320 | nop | 982 | " nop\n" |
1321 | subq 2,$r0 ; rerun the instruction the break replaced | 983 | " subq 2,$r0 ; rerun the instruction the break replaced\n" |
1322 | is_static: | 984 | "is_static:\n" |
1323 | moveq 1,$r1 | 985 | " moveq 1,$r1\n" |
1324 | move.b $r1,[is_dyn_brkp] ; Set the state variable to dynamic breakpoint | 986 | " move.b $r1,[is_dyn_brkp] ; Set the state variable to dynamic breakpoint\n" |
1325 | move.d $r0,[reg+0x62] ; Save the return address in BRP | 987 | " move.d $r0,[cris_reg+0x62] ; Save the return address in BRP\n" |
1326 | move $usp,[reg+0x66] ; USP | 988 | " move $usp,[cris_reg+0x66] ; USP\n" |
1327 | ;; | 989 | ";;\n" |
1328 | ;; Handle the communication | 990 | ";; Handle the communication\n" |
1329 | ;; | 991 | ";;\n" |
1330 | move.d internal_stack+1020,$sp ; Use the internal stack which grows upward | 992 | " move.d internal_stack+1020,$sp ; Use the internal stack which grows upward\n" |
1331 | moveq 5,$r10 ; SIGTRAP | 993 | " moveq 5,$r10 ; SIGTRAP\n" |
1332 | jsr handle_exception ; Interactive routine | 994 | " jsr handle_exception ; Interactive routine\n" |
1333 | ;; | 995 | ";;\n" |
1334 | ;; Return to the caller | 996 | ";; Return to the caller\n" |
1335 | ;; | 997 | ";;\n" |
1336 | move.d [reg],$r0 ; Restore R0 | 998 | " move.d [cris_reg],$r0 ; Restore R0\n" |
1337 | move.d [reg+0x04],$r1 ; Restore R1 | 999 | " move.d [cris_reg+0x04],$r1 ; Restore R1\n" |
1338 | move.d [reg+0x08],$r2 ; Restore R2 | 1000 | " move.d [cris_reg+0x08],$r2 ; Restore R2\n" |
1339 | move.d [reg+0x0C],$r3 ; Restore R3 | 1001 | " move.d [cris_reg+0x0C],$r3 ; Restore R3\n" |
1340 | move.d [reg+0x10],$r4 ; Restore R4 | 1002 | " move.d [cris_reg+0x10],$r4 ; Restore R4\n" |
1341 | move.d [reg+0x14],$r5 ; Restore R5 | 1003 | " move.d [cris_reg+0x14],$r5 ; Restore R5\n" |
1342 | move.d [reg+0x18],$r6 ; Restore R6 | 1004 | " move.d [cris_reg+0x18],$r6 ; Restore R6\n" |
1343 | move.d [reg+0x1C],$r7 ; Restore R7 | 1005 | " move.d [cris_reg+0x1C],$r7 ; Restore R7\n" |
1344 | move.d [reg+0x20],$r8 ; Restore R8 | 1006 | " move.d [cris_reg+0x20],$r8 ; Restore R8\n" |
1345 | move.d [reg+0x24],$r9 ; Restore R9 | 1007 | " move.d [cris_reg+0x24],$r9 ; Restore R9\n" |
1346 | move.d [reg+0x28],$r10 ; Restore R10 | 1008 | " move.d [cris_reg+0x28],$r10 ; Restore R10\n" |
1347 | move.d [reg+0x2C],$r11 ; Restore R11 | 1009 | " move.d [cris_reg+0x2C],$r11 ; Restore R11\n" |
1348 | move.d [reg+0x30],$r12 ; Restore R12 | 1010 | " move.d [cris_reg+0x30],$r12 ; Restore R12\n" |
1349 | move.d [reg+0x34],$r13 ; Restore R13 | 1011 | " move.d [cris_reg+0x34],$r13 ; Restore R13\n" |
1350 | ;; | 1012 | ";;\n" |
1351 | ;; FIXME: Which registers should be restored? | 1013 | ";; FIXME: Which registers should be restored?\n" |
1352 | ;; | 1014 | ";;\n" |
1353 | move.d [reg+0x38],$sp ; Restore SP (R14) | 1015 | " move.d [cris_reg+0x38],$sp ; Restore SP (R14)\n" |
1354 | move [reg+0x56],$srp ; Restore the subroutine return pointer. | 1016 | " move [cris_reg+0x56],$srp ; Restore the subroutine return pointer.\n" |
1355 | move [reg+0x5E],$dccr ; Restore DCCR | 1017 | " move [cris_reg+0x5E],$dccr ; Restore DCCR\n" |
1356 | move [reg+0x66],$usp ; Restore USP | 1018 | " move [cris_reg+0x66],$usp ; Restore USP\n" |
1357 | jump [reg+0x62] ; A jump to the content in register BRP works. | 1019 | " jump [cris_reg+0x62] ; A jump to the content in register BRP works.\n" |
1358 | nop ; | 1020 | " nop ;\n" |
1359 | "); | 1021 | "\n"); |
1360 | 1022 | ||
1361 | /* The hook for an interrupt generated by GDB. An internal stack is used | 1023 | /* The hook for an interrupt generated by GDB. An internal stack is used |
1362 | by the stub. The register image of the caller is stored in the structure | 1024 | by the stub. The register image of the caller is stored in the structure |
@@ -1367,94 +1029,94 @@ is_static: | |||
1367 | 1029 | ||
1368 | void kgdb_handle_serial(void); | 1030 | void kgdb_handle_serial(void); |
1369 | 1031 | ||
1370 | asm (" | 1032 | asm ("\n" |
1371 | .global kgdb_handle_serial | 1033 | " .global kgdb_handle_serial\n" |
1372 | kgdb_handle_serial: | 1034 | "kgdb_handle_serial:\n" |
1373 | ;; | 1035 | ";;\n" |
1374 | ;; Response to a serial interrupt | 1036 | ";; Response to a serial interrupt\n" |
1375 | ;; | 1037 | ";;\n" |
1376 | 1038 | "\n" | |
1377 | move $dccr,[reg+0x5E] ; Save the flags in DCCR | 1039 | " move $dccr,[cris_reg+0x5E] ; Save the flags in DCCR\n" |
1378 | di ; Disable interrupts | 1040 | " di ; Disable interrupts\n" |
1379 | move.d $r0,[reg] ; Save R0 | 1041 | " move.d $r0,[cris_reg] ; Save R0\n" |
1380 | move.d $r1,[reg+0x04] ; Save R1 | 1042 | " move.d $r1,[cris_reg+0x04] ; Save R1\n" |
1381 | move.d $r2,[reg+0x08] ; Save R2 | 1043 | " move.d $r2,[cris_reg+0x08] ; Save R2\n" |
1382 | move.d $r3,[reg+0x0C] ; Save R3 | 1044 | " move.d $r3,[cris_reg+0x0C] ; Save R3\n" |
1383 | move.d $r4,[reg+0x10] ; Save R4 | 1045 | " move.d $r4,[cris_reg+0x10] ; Save R4\n" |
1384 | move.d $r5,[reg+0x14] ; Save R5 | 1046 | " move.d $r5,[cris_reg+0x14] ; Save R5\n" |
1385 | move.d $r6,[reg+0x18] ; Save R6 | 1047 | " move.d $r6,[cris_reg+0x18] ; Save R6\n" |
1386 | move.d $r7,[reg+0x1C] ; Save R7 | 1048 | " move.d $r7,[cris_reg+0x1C] ; Save R7\n" |
1387 | move.d $r8,[reg+0x20] ; Save R8 | 1049 | " move.d $r8,[cris_reg+0x20] ; Save R8\n" |
1388 | move.d $r9,[reg+0x24] ; Save R9 | 1050 | " move.d $r9,[cris_reg+0x24] ; Save R9\n" |
1389 | move.d $r10,[reg+0x28] ; Save R10 | 1051 | " move.d $r10,[cris_reg+0x28] ; Save R10\n" |
1390 | move.d $r11,[reg+0x2C] ; Save R11 | 1052 | " move.d $r11,[cris_reg+0x2C] ; Save R11\n" |
1391 | move.d $r12,[reg+0x30] ; Save R12 | 1053 | " move.d $r12,[cris_reg+0x30] ; Save R12\n" |
1392 | move.d $r13,[reg+0x34] ; Save R13 | 1054 | " move.d $r13,[cris_reg+0x34] ; Save R13\n" |
1393 | move.d $sp,[reg+0x38] ; Save SP (R14) | 1055 | " move.d $sp,[cris_reg+0x38] ; Save SP (R14)\n" |
1394 | move $irp,[reg+0x3c] ; Save the address in PC (R15) | 1056 | " move $irp,[cris_reg+0x3c] ; Save the address in PC (R15)\n" |
1395 | clear.b [reg+0x40] ; Clear P0 | 1057 | " clear.b [cris_reg+0x40] ; Clear P0\n" |
1396 | move $vr,[reg+0x41] ; Save special register P1, | 1058 | " move $vr,[cris_reg+0x41] ; Save special register P1,\n" |
1397 | clear.w [reg+0x42] ; Clear P4 | 1059 | " clear.w [cris_reg+0x42] ; Clear P4\n" |
1398 | move $ccr,[reg+0x44] ; Save special register CCR | 1060 | " move $ccr,[cris_reg+0x44] ; Save special register CCR\n" |
1399 | move $mof,[reg+0x46] ; P7 | 1061 | " move $mof,[cris_reg+0x46] ; P7\n" |
1400 | clear.d [reg+0x4A] ; Clear P8 | 1062 | " clear.d [cris_reg+0x4A] ; Clear P8\n" |
1401 | move $ibr,[reg+0x4E] ; P9, | 1063 | " move $ibr,[cris_reg+0x4E] ; P9,\n" |
1402 | move $irp,[reg+0x52] ; P10, | 1064 | " move $irp,[cris_reg+0x52] ; P10,\n" |
1403 | move $srp,[reg+0x56] ; P11, | 1065 | " move $srp,[cris_reg+0x56] ; P11,\n" |
1404 | move $dtp0,[reg+0x5A] ; P12, register BAR, assembler might not know BAR | 1066 | " move $dtp0,[cris_reg+0x5A] ; P12, register BAR, assembler might not know BAR\n" |
1405 | ; P13, register DCCR already saved | 1067 | " ; P13, register DCCR already saved\n" |
1406 | ;; Due to the old assembler-versions BRP might not be recognized | 1068 | ";; Due to the old assembler-versions BRP might not be recognized\n" |
1407 | .word 0xE670 ; move brp,r0 | 1069 | " .word 0xE670 ; move brp,r0\n" |
1408 | move.d $r0,[reg+0x62] ; Save the return address in BRP | 1070 | " move.d $r0,[cris_reg+0x62] ; Save the return address in BRP\n" |
1409 | move $usp,[reg+0x66] ; USP | 1071 | " move $usp,[cris_reg+0x66] ; USP\n" |
1410 | 1072 | "\n" | |
1411 | ;; get the serial character (from debugport.c) and check if it is a ctrl-c | 1073 | ";; get the serial character (from debugport.c) and check if it is a ctrl-c\n" |
1412 | 1074 | "\n" | |
1413 | jsr getDebugChar | 1075 | " jsr getDebugChar\n" |
1414 | cmp.b 3, $r10 | 1076 | " cmp.b 3, $r10\n" |
1415 | bne goback | 1077 | " bne goback\n" |
1416 | nop | 1078 | " nop\n" |
1417 | 1079 | "\n" | |
1418 | move.d [reg+0x5E], $r10 ; Get DCCR | 1080 | " move.d [cris_reg+0x5E], $r10 ; Get DCCR\n" |
1419 | btstq 8, $r10 ; Test the U-flag. | 1081 | " btstq 8, $r10 ; Test the U-flag.\n" |
1420 | bmi goback | 1082 | " bmi goback\n" |
1421 | nop | 1083 | " nop\n" |
1422 | 1084 | "\n" | |
1423 | ;; | 1085 | ";;\n" |
1424 | ;; Handle the communication | 1086 | ";; Handle the communication\n" |
1425 | ;; | 1087 | ";;\n" |
1426 | move.d internal_stack+1020,$sp ; Use the internal stack | 1088 | " move.d internal_stack+1020,$sp ; Use the internal stack\n" |
1427 | moveq 2,$r10 ; SIGINT | 1089 | " moveq 2,$r10 ; SIGINT\n" |
1428 | jsr handle_exception ; Interactive routine | 1090 | " jsr handle_exception ; Interactive routine\n" |
1429 | 1091 | "\n" | |
1430 | goback: | 1092 | "goback:\n" |
1431 | ;; | 1093 | ";;\n" |
1432 | ;; Return to the caller | 1094 | ";; Return to the caller\n" |
1433 | ;; | 1095 | ";;\n" |
1434 | move.d [reg],$r0 ; Restore R0 | 1096 | " move.d [cris_reg],$r0 ; Restore R0\n" |
1435 | move.d [reg+0x04],$r1 ; Restore R1 | 1097 | " move.d [cris_reg+0x04],$r1 ; Restore R1\n" |
1436 | move.d [reg+0x08],$r2 ; Restore R2 | 1098 | " move.d [cris_reg+0x08],$r2 ; Restore R2\n" |
1437 | move.d [reg+0x0C],$r3 ; Restore R3 | 1099 | " move.d [cris_reg+0x0C],$r3 ; Restore R3\n" |
1438 | move.d [reg+0x10],$r4 ; Restore R4 | 1100 | " move.d [cris_reg+0x10],$r4 ; Restore R4\n" |
1439 | move.d [reg+0x14],$r5 ; Restore R5 | 1101 | " move.d [cris_reg+0x14],$r5 ; Restore R5\n" |
1440 | move.d [reg+0x18],$r6 ; Restore R6 | 1102 | " move.d [cris_reg+0x18],$r6 ; Restore R6\n" |
1441 | move.d [reg+0x1C],$r7 ; Restore R7 | 1103 | " move.d [cris_reg+0x1C],$r7 ; Restore R7\n" |
1442 | move.d [reg+0x20],$r8 ; Restore R8 | 1104 | " move.d [cris_reg+0x20],$r8 ; Restore R8\n" |
1443 | move.d [reg+0x24],$r9 ; Restore R9 | 1105 | " move.d [cris_reg+0x24],$r9 ; Restore R9\n" |
1444 | move.d [reg+0x28],$r10 ; Restore R10 | 1106 | " move.d [cris_reg+0x28],$r10 ; Restore R10\n" |
1445 | move.d [reg+0x2C],$r11 ; Restore R11 | 1107 | " move.d [cris_reg+0x2C],$r11 ; Restore R11\n" |
1446 | move.d [reg+0x30],$r12 ; Restore R12 | 1108 | " move.d [cris_reg+0x30],$r12 ; Restore R12\n" |
1447 | move.d [reg+0x34],$r13 ; Restore R13 | 1109 | " move.d [cris_reg+0x34],$r13 ; Restore R13\n" |
1448 | ;; | 1110 | ";;\n" |
1449 | ;; FIXME: Which registers should be restored? | 1111 | ";; FIXME: Which registers should be restored?\n" |
1450 | ;; | 1112 | ";;\n" |
1451 | move.d [reg+0x38],$sp ; Restore SP (R14) | 1113 | " move.d [cris_reg+0x38],$sp ; Restore SP (R14)\n" |
1452 | move [reg+0x56],$srp ; Restore the subroutine return pointer. | 1114 | " move [cris_reg+0x56],$srp ; Restore the subroutine return pointer.\n" |
1453 | move [reg+0x5E],$dccr ; Restore DCCR | 1115 | " move [cris_reg+0x5E],$dccr ; Restore DCCR\n" |
1454 | move [reg+0x66],$usp ; Restore USP | 1116 | " move [cris_reg+0x66],$usp ; Restore USP\n" |
1455 | reti ; Return from the interrupt routine | 1117 | " reti ; Return from the interrupt routine\n" |
1456 | nop | 1118 | " nop\n" |
1457 | "); | 1119 | "\n"); |
1458 | 1120 | ||
1459 | /* Use this static breakpoint in the start-up only. */ | 1121 | /* Use this static breakpoint in the start-up only. */ |
1460 | 1122 | ||
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index ab725edbc680..acff3df8c43f 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -640,8 +640,6 @@ config ETRAX_STREAMCOPROC | |||
640 | This option enables a driver for the stream co-processor | 640 | This option enables a driver for the stream co-processor |
641 | for cryptographic operations. | 641 | for cryptographic operations. |
642 | 642 | ||
643 | source drivers/mmc/Kconfig | ||
644 | |||
645 | config ETRAX_MMC_IOP | 643 | config ETRAX_MMC_IOP |
646 | tristate "MMC/SD host driver using IO-processor" | 644 | tristate "MMC/SD host driver using IO-processor" |
647 | depends on ETRAX_ARCH_V32 && MMC | 645 | depends on ETRAX_ARCH_V32 && MMC |
@@ -833,9 +831,4 @@ config ETRAX_SPI_MMC_WP_GPIO_PIN | |||
833 | The pin to use for the SD/MMC write-protect signal for a memory | 831 | The pin to use for the SD/MMC write-protect signal for a memory |
834 | card. If defined as " " (space), the card is considered writable. | 832 | card. If defined as " " (space), the card is considered writable. |
835 | 833 | ||
836 | # Avoid choices causing non-working configs by conditionalizing the inclusion. | ||
837 | if ETRAX_SPI_MMC | ||
838 | source drivers/spi/Kconfig | ||
839 | endif | ||
840 | |||
841 | endif | 834 | endif |
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index f1e79edc9dd2..c8325455520e 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild | |||
@@ -5,5 +5,9 @@ header-y += arch-v32/ | |||
5 | 5 | ||
6 | generic-y += clkdev.h | 6 | generic-y += clkdev.h |
7 | generic-y += exec.h | 7 | generic-y += exec.h |
8 | generic-y += kvm_para.h | ||
9 | generic-y += linkage.h | ||
8 | generic-y += module.h | 10 | generic-y += module.h |
9 | generic-y += trace_clock.h | 11 | generic-y += trace_clock.h |
12 | generic-y += vga.h | ||
13 | generic-y += xor.h | ||
diff --git a/arch/cris/include/asm/io.h b/arch/cris/include/asm/io.h index ac12ae2b9286..5d3047e5563b 100644 --- a/arch/cris/include/asm/io.h +++ b/arch/cris/include/asm/io.h | |||
@@ -167,6 +167,9 @@ static inline void outsl(unsigned int port, const void *addr, | |||
167 | cris_iops->write_io(port, (void *)addr, 4, count); | 167 | cris_iops->write_io(port, (void *)addr, 4, count); |
168 | } | 168 | } |
169 | 169 | ||
170 | #define inb_p(port) inb(port) | ||
171 | #define outb_p(val, port) outb((val), (port)) | ||
172 | |||
170 | /* | 173 | /* |
171 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 174 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
172 | * access | 175 | * access |
diff --git a/arch/cris/include/asm/linkage.h b/arch/cris/include/asm/linkage.h deleted file mode 100644 index 291c2d01c44f..000000000000 --- a/arch/cris/include/asm/linkage.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_LINKAGE_H | ||
2 | #define __ASM_LINKAGE_H | ||
3 | |||
4 | /* Nothing to see here... */ | ||
5 | |||
6 | #endif | ||