/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef OSAL_LINUX_IO_ADAPTER_H #define OSAL_LINUX_IO_ADAPTER_H #include "los_reg.h" #include "los_arch_context.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ #define writeb(value, address) ({ dsb(); WRITE_UINT8(value, address); }) #define writew(value, address) ({ dsb(); WRITE_UINT16(value, address); }) #define writel(value, address) ({ dsb(); WRITE_UINT32(value, address); }) #define readb(address) GET_UINT8(address) #define readw(address) GET_UINT16(address) #define readl(address) GET_UINT32(address) #ifdef __cplusplus #if __cplusplus } #endif /* __cplusplus */ #endif /* __cplusplus */ #endif /* OSAL_LINUX_IO_ADAPTER_H */