On Mar 17, 3:08 pm, (Patrick Klos) <spamt...@[EMAIL PROTECTED]
> wrote:
> In article
<7366de24-bc1c-47f1-9fc1-6de7d66d6...@[EMAIL PROTECTED]
>,
> Stargazer <spamt...@[EMAIL PROTECTED]
> wrote:
>
> >Hi,
>
> >I am writing my own real-time kernel for x86. Now I face something
> >really strange (or may be rather it's not; it has been some time since
> >I was in the details of x86 microarchitecture).
>
> >I measured CPU clocks elapsed between the first assembly instruction
> >executed at interrupt's entry point in IDT and beginning of the C code
> >of user-defined interrupt handler and the result was a big
> >surprise :-) It took about 2500 cycles despite that I have only a
> >handful of assembly instructions before a call to user-supplied IRQ
> >handler.
>
> >A little more testing showed that almost all cycles (2300+) were spent
> >at access to a global variable (via ds:[] addressing).
>
> Is this a SINGLE memory access or several/many accesses?
It's a single read-modify-write instruction (see "inc [xxx]" in the
posted code). I don't know how would you define it, just hope that
there isn't some fancy incrementer in memory controller :-) Normal
single memory accesses which I also do (see "bt" and 2 "mov"s after
"rdtsc") don't cause anything unexpected.
D


|