1 Star 0 Fork 5.4K

OpenHarmony_EU incubator / docs

forked from OpenHarmony / docs 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
osal_atomic-h.md 7.21 KB
Copy Edit Raw Blame History
wenjun authored 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

osal_atomic.h

Overview

Related Modules:

OSAL

Description:

Declares atomic and bit operation interfaces.

This file provides interfaces such as reading and setting an atomic, incrementing and decrementing an atomic counter by 1. This file also provides interfaces such as checking the bit status of a variable, and setting and clearing the bit value of a variable.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

OsalAtomic

Describes an atomic.

Functions

Function Name

Description

OsalAtomicRead (const OsalAtomic *v)

int32_t

Reads the counter of an atomic.

OsalAtomicSet (OsalAtomic *v, int32_t counter)

void

Sets the counter for an atomic.

OsalAtomicInc (OsalAtomic *v)

void

Increments the counter of an atomic by 1.

OsalAtomicDec (OsalAtomic *v)

void

Decrements the counter of an atomic by 1.

OsalTestBit (unsigned long nr, const volatile unsigned long *addr)

int32_t

Tests the value of a specified bit of a variable.

OsalTestSetBit (unsigned long nr, volatile unsigned long *addr)

int32_t

Sets the value of a specified bit of the variable and returns the bit value before the setting.

OsalTestClearBit (unsigned long nr, volatile unsigned long *addr)

int32_t

Clears the value of a specified bit of the variable and returns the bit value before clearing.

OsalClearBit (unsigned long nr, volatile unsigned long *addr)

void

Clears the value of a specified bit of the variable.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/open-harmony-eu-incubator/docs.git
git@gitee.com:open-harmony-eu-incubator/docs.git
open-harmony-eu-incubator
docs
docs
master

Search

344bd9b3 5694891 D2dac590 5694891