Subversion Repositories HelenOS-historic

Rev

Rev 238 | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright (C) 2005 Jakub Vana
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * - Redistributions of source code must retain the above copyright
  10.  *   notice, this list of conditions and the following disclaimer.
  11.  * - Redistributions in binary form must reproduce the above copyright
  12.  *   notice, this list of conditions and the following disclaimer in the
  13.  *   documentation and/or other materials provided with the distribution.
  14.  * - The name of the author may not be used to endorse or promote products
  15.  *   derived from this software without specific prior written permission.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  19.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  20.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  21.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  22.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  *
  28.  */
  29.  
  30.  
  31. #include <panic.h>
  32. #include <print.h>
  33. #include <arch/types.h>
  34. #include <arch/asm.h>
  35. #include <symtab.h>
  36.  
  37. extern __u64 REG_DUMP;
  38.  
  39.  
  40. void general_exception(void);
  41. void general_exception(void)
  42. {
  43.     panic("\nGeneral Exception\n");
  44. }
  45.  
  46.  
  47.  
  48. void break_instruction(void);
  49. void break_instruction(void)
  50. {
  51.     panic("\nBreak Instruction\n");
  52. }
  53.  
  54.  
  55. #define cr_dump(r) {__u64 val; get_control_register(r,val); printf("\ncr"#r":%Q",val);}
  56. #define ar_dump(r) {__u64 val; get_aplication_register(r,val); printf("\nar"#r":%Q",val);}
  57.  
  58. void universal_handler(void);
  59. void universal_handler(void)
  60. {
  61.     __u64 vector,psr,PC;
  62.     __u64 *p;
  63.     int i;
  64.     char *sym;
  65.    
  66.    
  67.     get_shadow_register(16,vector);
  68.  
  69.    
  70.     p=&REG_DUMP;
  71.  
  72.     for(i=0;i<128;i+=2) printf("gr%d:%Q\tgr%d:%Q\n",i,p[i],i+1,p[i+1]);
  73.  
  74.  
  75.     cr_dump(0);
  76.     cr_dump(1);
  77.     cr_dump(2);
  78.     cr_dump(8);
  79.     cr_dump(16);   
  80.     cr_dump(17);   
  81.     cr_dump(19);get_control_register(19,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym);
  82.     cr_dump(20);get_control_register(20,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym);  
  83.     cr_dump(21);   
  84.     cr_dump(22);get_control_register(22,PC); if(sym=get_symtab_entry(PC)) printf("(%s)",sym);  
  85.     cr_dump(23);   
  86.     cr_dump(24);   
  87.     cr_dump(25);   
  88.     cr_dump(64);   
  89.     cr_dump(65);   
  90.     cr_dump(66);   
  91.     cr_dump(67);   
  92.     cr_dump(68);   
  93.     cr_dump(69);   
  94.     cr_dump(70);   
  95.     cr_dump(71);   
  96.     cr_dump(72);   
  97.     cr_dump(73);   
  98.     cr_dump(74);   
  99.     cr_dump(80);   
  100.     cr_dump(81);   
  101.    
  102.     ar_dump(0);
  103.     ar_dump(1);
  104.     ar_dump(2);
  105.     ar_dump(3);
  106.     ar_dump(4);
  107.     ar_dump(5);
  108.     ar_dump(6);
  109.     ar_dump(7);
  110.     ar_dump(16);   
  111.     ar_dump(17);   
  112.     ar_dump(18);   
  113.     ar_dump(19);   
  114.     ar_dump(21);   
  115.     ar_dump(24);   
  116.     ar_dump(25);   
  117.     ar_dump(26);   
  118.     ar_dump(27);   
  119.     ar_dump(28);   
  120.     ar_dump(29);   
  121.     ar_dump(30);   
  122.     ar_dump(32);   
  123.     ar_dump(36);   
  124.     ar_dump(40);   
  125.     ar_dump(44);   
  126.     ar_dump(64);   
  127.     ar_dump(65);   
  128.     ar_dump(66);   
  129.  
  130.     get_psr(psr);
  131.  
  132.     printf("\nPSR:%Q\n",psr);
  133.    
  134.     panic("\nException:%Q\n",vector);
  135. }
  136.  
  137.  
  138.