Re: (*(unsigned long *)&jiffies)++;

From: Tigran Aivazian (tigran@sco.COM)
Date: Mon Jan 10 2000 - 03:43:18 EST


Hi Petko,

On Fri, 7 Jan 2000, Petko Manolov wrote:
> AFAIK incl _lock_ the bus even without "lock" in fornt of the
> instruction
> on 386 machine. Or at least i386 instruction set manual say so.
> But there is no word about all this in the newest manual i got from
> Intel. Is this changed on i[56]86?

The section 7.1.2.1 (of Intel PIII, Volume III) says that automatic
LOCK-ing is done:

   * When executing an XCHG instruction that references memory.
   
   * When setting the B (busy) flag of a TSS descriptor.

   * When updating segment descriptors.

   * When updating page-directory and page-table entries.

   * Acknowledging interrupts.

so, inc is *not* one of them. On the next page it mentions cases when LOCK
prefix can be used (all other cases will generate invalid opcode exception):

   * The bit test and modify instructions (BTS, BTR, and BTC).

   * The exchange instructions (XADD, CMPXCHG, and CMPXCHG8B).
   
   * The LOCK prefix is automatically assumed for XCHG instruction.

   * The following single-operand arithmetic and logical instructions:
     INC, DEC, NOT, and NEG.

   * The following two-operand arithmetic and logical instructions: ADD,
     ADC, SUB, SBB, AND, OR, and XOR.

I know we all can read and cut'n'paste but sometimes it is nice to find
useful facts in a signle email message :)

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:15 EST