diff options
author | jhb <jhb@FreeBSD.org> | 2004-01-28 20:44:08 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-01-28 20:44:08 +0000 |
commit | 657a196e7a050d9d36fa60573c770822bdffdd5a (patch) | |
tree | 2c0d2a9ee57dcbe1354ee965e75ed09a0646aa35 /sys/i386/isa | |
parent | 7c38a96e26ea6ac5011842d1d51cd51ed70eb958 (diff) | |
download | FreeBSD-src-657a196e7a050d9d36fa60573c770822bdffdd5a.zip FreeBSD-src-657a196e7a050d9d36fa60573c770822bdffdd5a.tar.gz |
Optimize the i386 interrupt entry code to not reload the segment registers
if they already contain the correct kernel selectors.
Reviewed by: peter
Suggested by: peter
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/atpic_vector.s | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s index e3dc38f..4b819ce 100644 --- a/sys/i386/isa/atpic_vector.s +++ b/sys/i386/isa/atpic_vector.s @@ -63,12 +63,15 @@ IDTVEC(vec_name) ; \ pushl %ds ; /* save data and extra segments ... */ \ pushl %es ; \ pushl %fs ; \ + mov %fs,%ax ; /* get current per-cpu selector */ \ + cmp $KPSEL,%ax ; /* are we already in the kernel? */ \ + je 1f ; /* skip expensive segment reloads */ \ mov $KDSEL,%ax ; /* load kernel ds, es and fs */ \ mov %ax,%ds ; \ mov %ax,%es ; \ mov $KPSEL,%ax ; \ mov %ax,%fs ; \ -; \ +1: ; \ FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \ pushl $irq_num; /* pass the IRQ */ \ call atpic_handle_intr ; \ |