1 /* --COPYRIGHT--,EPL
2 * Copyright (c) 2008 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 * --/COPYRIGHT--*/
12 /*!
13 * ======== Atomic ========
14 * Simple atomic operations on integers
15 *
16 * This module provides simple "atomic" operations on integral variables.
17 * These operations reliably read, modify, and store a specified value
18 * even in the face of preempting threads that modify the same variables.
19 *
20 * Atomic operations are used as a simple counting semaphore between an
21 * appliation and an interrupt service ruotine, for example.
22 */
23 module Atomic
24 {
25 /*!
26 * ======== inc8 ========
27 * Atomically increment val by 1
28 */
29 @DirectCall
30 Void inc8(UInt8 *val);
31
32 /*!
33 * ======== dec8 ========
34 * Atomically decrement val by 1
35 */
36 @DirectCall
37 Void dec8(UInt8 *val);
38 }