mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
Add Yu Qiang's patch for RGMP support on the ARM
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3843 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -40,10 +40,12 @@
|
||||
#ifndef __RGMP_ARCH_ARCH_H
|
||||
#define __RGMP_ARCH_ARCH_H
|
||||
|
||||
#include <arch/subarch/arch.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <nuttx/sched.h>
|
||||
#include <rgmp/hpet.h>
|
||||
|
||||
|
||||
struct up_wait {
|
||||
struct up_wait *next;
|
||||
@@ -57,16 +59,6 @@ void up_sigentry(void);
|
||||
int up_register_bridge(char *name, int size);
|
||||
int up_unregister_bridge(char *name);
|
||||
|
||||
static inline void up_mdelay(uint32_t msec)
|
||||
{
|
||||
hpet_ndelay(msec*1000000);
|
||||
}
|
||||
|
||||
static inline void up_udelay(uint32_t usec)
|
||||
{
|
||||
hpet_udelay(usec*1000);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/****************************************************************************
|
||||
* arch/rgmp/include/arm/arch/subarch/arch.h
|
||||
*
|
||||
* Copyright (C) 2011 Yu Qiang. All rights reserved.
|
||||
* Author: Yu Qiang <yuq825@gmail.com>
|
||||
*
|
||||
* This file is a part of NuttX:
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __RGMP_ARCH_SUBARCH_ARCH_H
|
||||
#define __RGMP_ARCH_SUBARCH_ARCH_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
static inline void up_mdelay(uint32_t msec)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static inline void up_udelay(uint32_t usec)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif
|
||||
@@ -44,9 +44,9 @@
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <rgmp/trap.h>
|
||||
#include <rgmp/spinlock.h>
|
||||
#include <arch/types.h>
|
||||
#include <rgmp/trap.h>
|
||||
|
||||
struct xcptcontext {
|
||||
struct Trapframe *tf;
|
||||
@@ -56,6 +56,9 @@ struct xcptcontext {
|
||||
void *sigdeliver;
|
||||
};
|
||||
|
||||
void push_xcptcontext(struct xcptcontext *xcp);
|
||||
void pop_xcptcontext(struct xcptcontext *xcp);
|
||||
|
||||
extern int nest_irq;
|
||||
|
||||
static inline irqstate_t irqsave(void)
|
||||
@@ -68,5 +71,6 @@ static inline void irqrestore(irqstate_t flags)
|
||||
popcli(flags);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -207,29 +207,7 @@
|
||||
* provided by their toolchain header files.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_RGMP
|
||||
#include <rgmp/types.h>
|
||||
#else
|
||||
typedef _int8_t int8_t;
|
||||
typedef _uint8_t uint8_t;
|
||||
|
||||
typedef _int16_t int16_t;
|
||||
typedef _uint16_t uint16_t;
|
||||
|
||||
#ifdef __INT24_DEFINED
|
||||
typedef _int24_t int24_t;
|
||||
typedef _uint24_t uint24_t;
|
||||
#endif
|
||||
|
||||
typedef _int32_t int32_t;
|
||||
typedef _uint32_t uint32_t;
|
||||
|
||||
#ifdef __INT64_DEFINED
|
||||
typedef _int64_t int64_t;
|
||||
typedef _uint64_t uint64_t;
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_ARCH_RGMP */
|
||||
|
||||
/* Minimum-width integer types */
|
||||
|
||||
|
||||
@@ -54,6 +54,5 @@
|
||||
#define COM_6_BITS 1
|
||||
#define COM_5_BITS 0
|
||||
|
||||
void up_serialinit(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,60 @@
|
||||
/****************************************************************************
|
||||
* arch/rgmp/include/x86/arch/subarch/arch.h
|
||||
*
|
||||
* Copyright (C) 2011 Yu Qiang. All rights reserved.
|
||||
* Author: Yu Qiang <yuq825@gmail.com>
|
||||
*
|
||||
* This file is a part of NuttX:
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __RGMP_ARCH_SUBARCH_ARCH_H
|
||||
#define __RGMP_ARCH_SUBARCH_ARCH_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <rgmp/arch/hpet.h>
|
||||
|
||||
|
||||
static inline void up_mdelay(uint32_t msec)
|
||||
{
|
||||
hpet_ndelay(msec*1000000);
|
||||
}
|
||||
|
||||
static inline void up_udelay(uint32_t usec)
|
||||
{
|
||||
hpet_udelay(usec*1000);
|
||||
}
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user