[lkml]   [2013]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectReason for playing games with vector number on x86-64 interrupt handling

I have a question related to interrupt handling on x86-64.

entry_64.s cains the following code:
pushq_cfi $(~vector+0x80) /* Note: always in signed byte range */
and later
addq $-0x80,(%rsp) /* Adjust vector to [-256,-1] range *
and then finally in irq.c
unsigned vector = ~regs->orig_ax;

if I'm not mistaken regs->orig_ax contains ((~vector+0x80) -0x80) =
~vector and applying ~ again gives vector.

I was wondering, what is the reason for all those games with vector?
why not just push vector in the begging and save later instructions?

Please CC me in your answers.

 \ /
  Last update: 2013-02-03 21:01    [W:2.303 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site