/[qemu]/qemu/tests/testsig.c
ViewVC logotype

Diff of /qemu/tests/testsig.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by bellard, Thu May 8 15:32:33 2003 UTC revision 1.5 by bellard, Tue May 13 00:29:04 2003 UTC
# Line 67  int tab[2]; Line 67  int tab[2];
67  int main(int argc, char **argv)  int main(int argc, char **argv)
68  {  {
69      struct sigaction act;      struct sigaction act;
70      int val;      volatile int val;
71            
72      act.sa_sigaction = sig_handler;      act.sa_sigaction = sig_handler;
73      sigemptyset(&act.sa_mask);      sigemptyset(&act.sa_mask);
# Line 75  int main(int argc, char **argv) Line 75  int main(int argc, char **argv)
75      sigaction(SIGFPE, &act, NULL);      sigaction(SIGFPE, &act, NULL);
76      sigaction(SIGILL, &act, NULL);      sigaction(SIGILL, &act, NULL);
77      sigaction(SIGSEGV, &act, NULL);      sigaction(SIGSEGV, &act, NULL);
78        sigaction(SIGTRAP, &act, NULL);
79    
80      /* test division by zero reporting */      /* test division by zero reporting */
81      if (setjmp(jmp_env) == 0) {      if (setjmp(jmp_env) == 0) {
# Line 112  int main(int argc, char **argv) Line 113  int main(int argc, char **argv)
113          asm volatile ("int $0xfd");          asm volatile ("int $0xfd");
114      }      }
115    
116        printf("INT3 exception:\n");
117        if (setjmp(jmp_env) == 0) {
118            asm volatile ("int3");
119        }
120    
121      printf("CLI exception:\n");      printf("CLI exception:\n");
122      if (setjmp(jmp_env) == 0) {      if (setjmp(jmp_env) == 0) {
123          asm volatile ("cli");          asm volatile ("cli");
# Line 158  int main(int argc, char **argv) Line 164  int main(int argc, char **argv)
164    
165      printf("HLT exception:\n");      printf("HLT exception:\n");
166      if (setjmp(jmp_env) == 0) {      if (setjmp(jmp_env) == 0) {
167          asm volatile ("hlt" : : "d" (0x4321), "D" (tab), "c" (1));          asm volatile ("hlt");
168      }      }
169    
170  #if 0      printf("single step exception:\n");
171        val = 0;
172        if (setjmp(jmp_env) == 0) {
173            asm volatile ("pushf\n"
174                          "orl $0x00100, (%%esp)\n"
175                          "popf\n"
176                          "movl $0xabcd, %0\n" : "=m" (val) : : "cc", "memory");
177        }
178        printf("val=0x%x\n", val);
179        
180    #if 1
181      {      {
182          int i;          int i;
183          act.sa_handler = alarm_handler;          act.sa_handler = alarm_handler;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26