Subversion Repositories HelenOS

Rev

Rev 220 | Go to most recent revision | 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.  
  36. extern __u64 REG_DUMP;
  37.  
  38.  
  39. void general_exception(void);
  40. void general_exception(void)
  41. {
  42.     panic("\nGeneral Exception\n");
  43. }
  44.  
  45.  
  46.  
  47. void break_instruction(void);
  48. void break_instruction(void)
  49. {
  50.     panic("\nBreak Instruction\n");
  51. }
  52.  
  53.  
  54. #define cr_dump(r) {__u64 val; get_control_register(r,val); printf("cr"#r":%Q\n",val);}
  55. #define ar_dump(r) {__u64 val; get_aplication_register(r,val); printf("ar"#r":%Q\n",val);}
  56.  
  57. void universal_handler(void);
  58. void universal_handler(void)
  59. {
  60.     __u64 vector,psr;
  61.     __u64 *p;
  62.     int i;
  63.    
  64.    
  65.     get_shadow_register(16,vector);
  66.  
  67.    
  68.     p=&REG_DUMP;
  69.  
  70.     for(i=0;i<128;i+=2) printf("gr%d:%Q\tgr%d:%Q\n",i,p[i],i+1,p[i+1]);
  71.  
  72.  
  73.     cr_dump(0);
  74.     cr_dump(1);
  75.     cr_dump(2);
  76.     cr_dump(8);
  77.     cr_dump(16);   
  78.     cr_dump(17);   
  79.     cr_dump(19);   
  80.     cr_dump(20);   
  81.     cr_dump(21);   
  82.     cr_dump(22);   
  83.     cr_dump(23);   
  84.     cr_dump(24);   
  85.     cr_dump(25);   
  86.     cr_dump(64);   
  87.     cr_dump(65);   
  88.     cr_dump(66);   
  89.     cr_dump(67);   
  90.     cr_dump(68);   
  91.     cr_dump(69);   
  92.     cr_dump(70);   
  93.     cr_dump(71);   
  94.     cr_dump(72);   
  95.     cr_dump(73);   
  96.     cr_dump(74);   
  97.     cr_dump(80);   
  98.     cr_dump(81);   
  99.    
  100.     ar_dump(0);
  101.     ar_dump(1);
  102.     ar_dump(2);
  103.     ar_dump(3);
  104.     ar_dump(4);
  105.     ar_dump(5);
  106.     ar_dump(6);
  107.     ar_dump(7);
  108.     ar_dump(16);   
  109.     ar_dump(17);   
  110.     ar_dump(18);   
  111.     ar_dump(19);   
  112.     ar_dump(21);   
  113.     ar_dump(24);   
  114.     ar_dump(25);   
  115.     ar_dump(26);   
  116.     ar_dump(27);   
  117.     ar_dump(28);   
  118.     ar_dump(29);   
  119.     ar_dump(30);   
  120.     ar_dump(32);   
  121.     ar_dump(36);   
  122.     ar_dump(40);   
  123.     ar_dump(44);   
  124.     ar_dump(64);   
  125.     ar_dump(65);   
  126.     ar_dump(66);   
  127.  
  128.     get_psr(psr);
  129.  
  130.     printf("\nPSR:%Q\n",psr);
  131.    
  132.     panic("\nException:%Q\n",vector);
  133. }
  134.  
  135.  
  136.