Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4491338 in mainline


Ignore:
Timestamp:
2009-12-13T20:01:38Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
47a350f
Parents:
963dd91
Message:

Recognize the Division Error fault on ia32 and amd64.
Now when an application divides e.g. by zero, it will be killed with an
appropriate message (i.e. "Division error.") instead of dummy
"Unserviced interrupt: 0".

Location:
kernel/arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/interrupt.c

    r963dd91 r4491338  
    9898}
    9999
     100static void de_fault(int n, istate_t *istate)
     101{
     102        fault_if_from_uspace(istate, "Divide error.");
     103        decode_istate(n, istate);
     104        panic("Divide error.");
     105}
     106
    100107/** General Protection Fault. */
    101108static void gp_fault(int n, istate_t *istate)
     
    200207        }
    201208       
     209        exc_register(0, "de_fault", (iroutine) de_fault);
    202210        exc_register(7, "nm_fault", (iroutine) nm_fault);
    203211        exc_register(12, "ss_fault", (iroutine) ss_fault);
  • kernel/arch/ia32/src/interrupt.c

    r963dd91 r4491338  
    9898}
    9999
     100static void de_fault(int n, istate_t *istate)
     101{
     102        fault_if_from_uspace(istate, "Divide error.");
     103
     104        decode_istate(istate);
     105        panic("Divide error.");
     106}
     107
    100108/** General Protection Fault. */
    101109static void gp_fault(int n __attribute__((unused)), istate_t *istate)
     
    215223        }
    216224       
     225        exc_register(0, "de_fault", (iroutine) de_fault);
    217226        exc_register(7, "nm_fault", (iroutine) nm_fault);
    218227        exc_register(12, "ss_fault", (iroutine) ss_fault);
Note: See TracChangeset for help on using the changeset viewer.