2016-11-02 02:47:35 +08:00
|
|
|
/****************************************************************************
|
|
|
|
* arch/misoc/src/lm32/chip.h
|
|
|
|
*
|
2021-05-27 14:37:31 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you 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
|
2016-11-02 02:47:35 +08:00
|
|
|
*
|
2021-05-27 14:37:31 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2016-11-02 02:47:35 +08:00
|
|
|
*
|
2021-05-27 14:37:31 +08:00
|
|
|
* 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.
|
2016-11-02 02:47:35 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ARCH_MISOC_SRC_LM32_CHIP_H
|
2020-02-01 02:07:39 +08:00
|
|
|
#define __ARCH_MISOC_SRC_LM32_CHIP_H
|
2016-11-02 02:47:35 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
2021-03-30 17:35:11 +08:00
|
|
|
* Included Files
|
2016-11-02 02:47:35 +08:00
|
|
|
****************************************************************************/
|
2016-11-02 04:18:21 +08:00
|
|
|
|
|
|
|
#include "lm32.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Inline Functions
|
|
|
|
****************************************************************************/
|
2016-11-02 02:47:35 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static inline unsigned int irq_getie(void)
|
|
|
|
{
|
|
|
|
unsigned int ie;
|
|
|
|
__asm__ __volatile__("rcsr %0, IE" : "=r" (ie));
|
|
|
|
return ie;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void irq_setie(unsigned int ie)
|
|
|
|
{
|
|
|
|
__asm__ __volatile__("wcsr IE, %0" : : "r" (ie));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int irq_getmask(void)
|
|
|
|
{
|
|
|
|
unsigned int mask;
|
|
|
|
__asm__ __volatile__("rcsr %0, IM" : "=r" (mask));
|
|
|
|
return mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void irq_setmask(unsigned int mask)
|
|
|
|
{
|
|
|
|
__asm__ __volatile__("wcsr IM, %0" : : "r" (mask));
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline unsigned int irq_pending(void)
|
|
|
|
{
|
|
|
|
unsigned int pending;
|
|
|
|
__asm__ __volatile__("rcsr %0, IP" : "=r" (pending));
|
|
|
|
return pending;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#endif /* __ARCH_MISOC_SRC_LM32_CHIP_H */
|