mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
Fix STM32 F2/F4 SDIO clocking; Clean-up files in sched/ directory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4940 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -2981,7 +2981,12 @@
|
||||
|
||||
* configs/lpc4330-xplorer/up_nsh.c: Add support for a basic SPIFI block
|
||||
driver for use by NSH. Does not work! Crashes on first SPIFI write.
|
||||
* configs/lpc4330-xplorer/*/defconfig: Calibrate delay loops (this is
|
||||
based on the current "slow" 72MHz M4 clock and will need to be
|
||||
re-calibrated when this is increased).
|
||||
|
||||
* configs/stm3220g-eval/include/board.h and configs/stm3240g-eval/include/board.h:
|
||||
The SDIOCLK frequency in the F2 and F4 derives for PLL48CLK and not HCLK
|
||||
so that the SDIOCLK input frequency should always be 48MHz.
|
||||
* sched/os_internal.h, sched_setupidlefiles.c, sched_setuptaskfiles.c, and
|
||||
sched_setupidlefiles.c: Detangle some conditional compilation. Allow for
|
||||
a perverse configuration that has socket descriptors and streams but no file
|
||||
descriptors (sure, why not?).
|
||||
* sched/: Stylistic clean-up of all files. Some of these files are pretty old
|
||||
and do not follow current NuttX coding standards in detail.
|
||||
|
||||
@@ -34,17 +34,19 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef __ARCH_BOARD_BOARD_H
|
||||
#define __ARCH_BOARD_BOARD_H
|
||||
#ifndef __CONFIGS_STM3220G_EVAL_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_STM3220G_EVAL_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "stm32_rcc.h"
|
||||
#include "stm32_sdio.h"
|
||||
#include "stm32_internal.h"
|
||||
@@ -168,29 +170,29 @@
|
||||
* to service FIFOs in interrupt driven mode. These values have not been
|
||||
* tuned!!!
|
||||
*
|
||||
* HCLK=72MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(178+2)=400 KHz
|
||||
* SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz
|
||||
*/
|
||||
|
||||
#define SDIO_INIT_CLKDIV (178 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
|
||||
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(2+2)=18 MHz
|
||||
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||
/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz
|
||||
* DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(1+2)=24 MHz
|
||||
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||
/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(0+2)= 24 MHz
|
||||
* DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)= 12 MHz
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_SDXFR_CLKDIV (0 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
/* Ethernet *************************************************************************/
|
||||
@@ -531,4 +533,4 @@ EXTERN void stm3220g_lcdclear(uint16_t color);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_BOARD_BOARD_H */
|
||||
#endif /* __CONFIGS_STM3220G_EVAL_INCLUDE_BOARD_H */
|
||||
|
||||
@@ -518,8 +518,8 @@ CONFIG_DEBUG_I2C=n
|
||||
CONFIG_DEBUG_INPUT=n
|
||||
CONFIG_DEBUG_DMA=n
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
CONFIG_HAVE_CXXINITIALIZE=n
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_MM_REGIONS=1
|
||||
CONFIG_ARCH_LOWPUTC=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
@@ -813,7 +813,6 @@ CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
|
||||
CONFIG_MMCSD_MMCSUPPORT=n
|
||||
CONFIG_MMCSD_HAVECARDDETECT=n
|
||||
|
||||
|
||||
#
|
||||
# TCP/IP and UDP support via uIP
|
||||
#
|
||||
@@ -1342,8 +1341,8 @@ CONFIG_STM32_ILI9325_DISABLE=n
|
||||
#
|
||||
# Settings for examples/uip
|
||||
#
|
||||
CONFIG_EXAMPLE_UIP_IPADDR==(192<<24|168<<16|21<<8|15)
|
||||
CONFIG_EXAMPLE_UIP_DRIPADDR=(192<<24|168<<16|21<<8|10)
|
||||
CONFIG_EXAMPLE_UIP_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||
CONFIG_EXAMPLE_UIP_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||
CONFIG_EXAMPLE_UIP_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||
CONFIG_EXAMPLE_UIP_DHCPC=n
|
||||
|
||||
@@ -1352,10 +1351,10 @@ CONFIG_EXAMPLE_UIP_DHCPC=n
|
||||
CONFIG_EXAMPLE_NETTEST_SERVER=n
|
||||
CONFIG_EXAMPLE_NETTEST_PERFORMANCE=n
|
||||
CONFIG_EXAMPLE_NETTEST_NOMAC=y
|
||||
CONFIG_EXAMPLE_NETTEST_IPADDR==(192<<24|168<<16|21<<8|15)
|
||||
CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|21<<8|10)
|
||||
CONFIG_EXAMPLE_NETTEST_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||
CONFIG_EXAMPLE_NETTEST_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|21<<8|10)
|
||||
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(10<<24|0<<16|0<<8|1)
|
||||
|
||||
#
|
||||
# Settings for examples/ostest
|
||||
@@ -1410,12 +1409,12 @@ CONFIG_NSH_DISABLEBG=n
|
||||
CONFIG_NSH_ROMFSETC=n
|
||||
CONFIG_NSH_CONSOLE=y
|
||||
CONFIG_NSH_TELNET=y
|
||||
CONFIG_NSH_ARCHINIT=n
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
CONFIG_NSH_DHCPC=n
|
||||
CONFIG_NSH_NOMAC=y
|
||||
CONFIG_NSH_IPADDR=(192<<24|168<<16|13<<8|161)
|
||||
CONFIG_NSH_DRIPADDR=(192<<24|168<<16|13<<8|1)
|
||||
CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2)
|
||||
CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1)
|
||||
CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||
CONFIG_NSH_ROMFSMOUNTPT="/etc"
|
||||
CONFIG_NSH_INITSCRIPT="init.d/rcS"
|
||||
|
||||
@@ -80,6 +80,10 @@ ifeq ($(CONFIG_WATCHDOG),y)
|
||||
CONFIGURED_APPS += examples/watchdog
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_STMPE811),y)
|
||||
CONFIGURED_APPS += examples/touchscreen
|
||||
endif
|
||||
|
||||
# Uncomment examples/ftpc to include the FTP client example
|
||||
# Uncomment examples/ftpd to include the FTP daemon example
|
||||
|
||||
@@ -87,3 +91,12 @@ ifeq ($(CONFIG_NET),y)
|
||||
#CONFIGURED_APPS += examples/ftpc
|
||||
#CONFIGURED_APPS += examples/ftpd
|
||||
endif
|
||||
|
||||
# Uncomment to select a graphics example
|
||||
|
||||
ifeq ($(CONFIG_NX),y)
|
||||
#CONFIGURED_APPS += examples/nx
|
||||
#CONFIGURED_APPS += examples/nxhello
|
||||
#CONFIGURED_APPS += examples/nximage
|
||||
#CONFIGURED_APPS += examples/nxlines
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -167,29 +167,29 @@
|
||||
* to service FIFOs in interrupt driven mode. These values have not been
|
||||
* tuned!!!
|
||||
*
|
||||
* HCLK=72MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(178+2)=400 KHz
|
||||
* SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(118+2)=400 KHz
|
||||
*/
|
||||
|
||||
#define SDIO_INIT_CLKDIV (178 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#define SDIO_INIT_CLKDIV (118 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
|
||||
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(2+2)=18 MHz
|
||||
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||
/* DMA ON: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(1+2)=16 MHz
|
||||
* DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_MMCXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(1+2)=24 MHz
|
||||
* DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
|
||||
/* DMA ON: HSDIOCLK=48MHz, SDIO_CK=SDIOCLK/(0+2)=24 MHz
|
||||
* DMA OFF: SDIOCLK=48MHz, SDIO_CK=SDIOCLK/(2+2)=12 MHz
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SDIO_DMA
|
||||
# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_SDXFR_CLKDIV (0 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#else
|
||||
# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||
#endif
|
||||
|
||||
/* Ethernet *************************************************************************/
|
||||
|
||||
@@ -541,7 +541,7 @@ CONFIG_START_MONTH=12
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_GREGORIAN_TIME=n
|
||||
CONFIG_JULIAN_TIME=n
|
||||
CONFIG_DEV_CONSOLE=y
|
||||
CONFIG_DEV_CONSOLE=n
|
||||
CONFIG_DEV_LOWCONSOLE=n
|
||||
CONFIG_MUTEX_TYPES=n
|
||||
CONFIG_PRIORITY_INHERITANCE=n
|
||||
@@ -1268,7 +1268,7 @@ CONFIG_NSH_NESTDEPTH=3
|
||||
CONFIG_NSH_DISABLESCRIPT=n
|
||||
CONFIG_NSH_DISABLEBG=n
|
||||
CONFIG_NSH_ROMFSETC=n
|
||||
CONFIG_NSH_CONSOLE=y
|
||||
CONFIG_NSH_CONSOLE=n
|
||||
CONFIG_NSH_TELNET=y
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_IOBUFFER_SIZE=512
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: atexit
|
||||
* Name: atexit
|
||||
*
|
||||
* Description:
|
||||
* Registers a function to be called at program exit.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* clock_abstime2ticks.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -69,7 +69,7 @@
|
||||
********************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
* Function: clock_abstime2ticks
|
||||
* Name: clock_abstime2ticks
|
||||
*
|
||||
* Description:
|
||||
* Convert an absolute timespec delay to system timer ticks.
|
||||
@@ -95,8 +95,8 @@ int clock_abstime2ticks(clockid_t clockid, FAR const struct timespec *abstime,
|
||||
struct timespec reltime;
|
||||
int ret;
|
||||
|
||||
/* Convert the timespec to clock ticks. NOTE: Here we use
|
||||
* internal knowledge that CLOCK_REALTIME is defined to be zero!
|
||||
/* Convert the timespec to clock ticks. NOTE: Here we use internal knowledge
|
||||
* that CLOCK_REALTIME is defined to be zero!
|
||||
*/
|
||||
|
||||
ret = clock_gettime(clockid, &currtime);
|
||||
@@ -105,15 +105,13 @@ int clock_abstime2ticks(clockid_t clockid, FAR const struct timespec *abstime,
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
/* The relative time to wait is the absolute time minus the
|
||||
* current time.
|
||||
*/
|
||||
/* The relative time to wait is the absolute time minus the current time. */
|
||||
|
||||
reltime.tv_nsec = (abstime->tv_nsec - currtime.tv_nsec);
|
||||
reltime.tv_sec = (abstime->tv_sec - currtime.tv_sec);
|
||||
|
||||
/* Check if we were supposed to borrow from the seconds to
|
||||
* borrow from the seconds
|
||||
/* Check if we were supposed to borrow from the seconds to borrow from the
|
||||
* seconds
|
||||
*/
|
||||
|
||||
if (reltime.tv_nsec < 0)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/clock_getres.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -79,7 +79,7 @@
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: clock_getres
|
||||
* Name: clock_getres
|
||||
*
|
||||
* Description:
|
||||
* Clock Functions based on POSIX APIs
|
||||
@@ -98,7 +98,7 @@ int clock_getres(clockid_t clock_id, struct timespec *res)
|
||||
if (clock_id != CLOCK_REALTIME)
|
||||
{
|
||||
sdbg("Returning ERROR\n");
|
||||
*get_errno_ptr() = EINVAL;
|
||||
set_errno(EINVAL);
|
||||
ret = ERROR;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: clock_gettime
|
||||
* Name: clock_gettime
|
||||
*
|
||||
* Description:
|
||||
* Clock Functions based on POSIX APIs
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/clock_gettimeofday.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -38,10 +38,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "clock_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -77,7 +78,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: gettimeofday
|
||||
* Name: gettimeofday
|
||||
*
|
||||
* Description:
|
||||
* Get the current time
|
||||
@@ -107,5 +108,6 @@ int gettimeofday(struct timeval *tp, void *tzp)
|
||||
tp->tv_sec = ts.tv_sec;
|
||||
tp->tv_usec = ts.tv_nsec / NSEC_PER_USEC;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ struct timespec g_basetime;
|
||||
**************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_basetime
|
||||
* Name: clock_basetime
|
||||
*
|
||||
* Description:
|
||||
* Get the initial time value from the best source available.
|
||||
@@ -170,7 +170,7 @@ static inline void clock_basetime(FAR struct timespec *tp)
|
||||
#endif /* CONFIG_RTC */
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_inittime
|
||||
* Name: clock_inittime
|
||||
*
|
||||
* Description:
|
||||
* Get the initial time value from the best source available.
|
||||
@@ -191,7 +191,7 @@ static void clock_inittime(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_initialize
|
||||
* Name: clock_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform one-time initialization of the timing facilities.
|
||||
@@ -212,7 +212,7 @@ void clock_initialize(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_synchronize
|
||||
* Name: clock_synchronize
|
||||
*
|
||||
* Description:
|
||||
* Synchronize the system timer to a hardware RTC. This operation is
|
||||
@@ -253,12 +253,12 @@ void clock_synchronize(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_timer
|
||||
* Name: clock_timer
|
||||
*
|
||||
* Description:
|
||||
* This function must be called once every time the real
|
||||
* time clock interrupt occurs. The interval of this
|
||||
* clock interrupt must be MSEC_PER_TICK
|
||||
* This function must be called once every time the real time clock
|
||||
* interrupt occurs. The interval of this clock interrupt must be
|
||||
* MSEC_PER_TICK
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
+12
-12
@@ -1,8 +1,8 @@
|
||||
/********************************************************************************
|
||||
* clock_internal.h
|
||||
* sched/clock_internal.h
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -33,8 +33,8 @@
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef __CLOCK_INTERNAL_H
|
||||
#define __CLOCK_INTERNAL_H
|
||||
#ifndef __SCHED_CLOCK_INTERNAL_H
|
||||
#define __SCHED_CLOCK_INTERNAL_H
|
||||
|
||||
/********************************************************************************
|
||||
* Included Files
|
||||
@@ -79,13 +79,13 @@ extern struct timespec g_basetime;
|
||||
* Public Function Prototypes
|
||||
********************************************************************************/
|
||||
|
||||
extern void weak_function clock_initialize(void);
|
||||
extern void weak_function clock_timer(void);
|
||||
void weak_function clock_initialize(void);
|
||||
void weak_function clock_timer(void);
|
||||
|
||||
extern int clock_abstime2ticks(clockid_t clockid,
|
||||
FAR const struct timespec *abstime,
|
||||
FAR int *ticks);
|
||||
extern int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks);
|
||||
extern int clock_ticks2time(int ticks, FAR struct timespec *reltime);
|
||||
int clock_abstime2ticks(clockid_t clockid,
|
||||
FAR const struct timespec *abstime,
|
||||
FAR int *ticks);
|
||||
int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks);
|
||||
int clock_ticks2time(int ticks, FAR struct timespec *reltime);
|
||||
|
||||
#endif /* __CLOCK_INTERNAL_H */
|
||||
#endif /* __SCHED_CLOCK_INTERNAL_H */
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: clock_settime
|
||||
* Name: clock_settime
|
||||
*
|
||||
* Description:
|
||||
* Clock Functions based on POSIX APIs
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/clock_systimer.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_systimer
|
||||
* Name: clock_systimer
|
||||
*
|
||||
* Description:
|
||||
* Return the current value of the 32-bit system timer counter
|
||||
@@ -85,7 +85,7 @@ uint32_t clock_systimer(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clock_systimer64
|
||||
* Name: clock_systimer64
|
||||
*
|
||||
* Description:
|
||||
* Return the current value of the 64-bit system timer counter
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* clock_ticks2time.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -67,7 +67,7 @@
|
||||
********************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
* Function: clock_ticks2time
|
||||
* Name: clock_ticks2time
|
||||
*
|
||||
* Description:
|
||||
* Convert the system time tick value to a relative time.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/clock_time2ticks.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -69,7 +69,7 @@
|
||||
********************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
* Function: clock_time2ticks
|
||||
* Name: clock_time2ticks
|
||||
*
|
||||
* Description:
|
||||
* Convert a timespec delay to system timer ticks. This function is suitable
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/env_clearenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -55,7 +55,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: clearenv
|
||||
* Name: clearenv
|
||||
*
|
||||
* Description:
|
||||
* The clearenv() function clears the environment of all name-value pairs
|
||||
|
||||
+3
-2
@@ -2,7 +2,7 @@
|
||||
* sched/env_dup.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -60,7 +60,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_dup
|
||||
* Name: env_dup
|
||||
*
|
||||
* Description:
|
||||
* Copy the internal environment structure of a task. This is the action
|
||||
@@ -122,6 +122,7 @@ int env_dup(FAR _TCB *ptcb)
|
||||
ptcb->envp = envp;
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* eched/env_dupenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: dupenv
|
||||
* Name: dupenv
|
||||
*
|
||||
* Description:
|
||||
* Copy the internal environment structure of a task. This is the action
|
||||
|
||||
+8
-4
@@ -2,7 +2,7 @@
|
||||
* sched/env_findvar.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -54,7 +54,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_cmpname
|
||||
* Name: env_cmpname
|
||||
****************************************************************************/
|
||||
|
||||
static bool env_cmpname(const char *pszname, const char *peqname)
|
||||
@@ -69,6 +69,7 @@ static bool env_cmpname(const char *pszname, const char *peqname)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ static bool env_cmpname(const char *pszname, const char *peqname)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_findvar
|
||||
* Name: env_findvar
|
||||
*
|
||||
* Description:
|
||||
* Search the provided environment structure for the variable of the
|
||||
@@ -109,7 +110,9 @@ FAR char *env_findvar(environ_t *envp, const char *pname)
|
||||
|
||||
/* Search for a name=value string with matching name */
|
||||
|
||||
for (ptr = envp->ev_env; ptr < end && !env_cmpname( pname, ptr); ptr += (strlen(ptr) + 1));
|
||||
for (ptr = envp->ev_env;
|
||||
ptr < end && !env_cmpname( pname, ptr);
|
||||
ptr += (strlen(ptr) + 1));
|
||||
|
||||
/* Check for success */
|
||||
|
||||
@@ -118,6 +121,7 @@ FAR char *env_findvar(environ_t *envp, const char *pname)
|
||||
ret = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -2,7 +2,7 @@
|
||||
* env_getenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: getenv
|
||||
* Name: getenv
|
||||
*
|
||||
* Description:
|
||||
* The getenv() function searches the environment list for a string that
|
||||
@@ -91,7 +91,6 @@ FAR char *getenv(const char *name)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
||||
/* Get a reference to the thread-private environ in the TCB.*/
|
||||
|
||||
sched_lock();
|
||||
@@ -126,7 +125,7 @@ FAR char *getenv(const char *name)
|
||||
errout_with_lock:
|
||||
sched_unlock();
|
||||
errout:
|
||||
*get_errno_ptr() = ret;
|
||||
set_errno(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* env_getenvironptr.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -56,7 +56,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: get_environ_ptr
|
||||
* Name: get_environ_ptr
|
||||
*
|
||||
* Description:
|
||||
* Return a pointer to the thread specific environ variable.
|
||||
@@ -75,9 +75,9 @@ FAR char **get_environ_ptr( void )
|
||||
{
|
||||
#if 1
|
||||
|
||||
/* Type of internal representation of environment is incompatible with
|
||||
* char ** return value.
|
||||
*/
|
||||
/* Type of internal representation of environment is incompatible with
|
||||
* char ** return value.
|
||||
*/
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/env_internal.h
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/env_putenv.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: putenv
|
||||
* Name: putenv
|
||||
*
|
||||
* Description:
|
||||
* The putenv() function adds or changes the value of environment variables.
|
||||
|
||||
+8
-5
@@ -2,7 +2,7 @@
|
||||
* sched/env_clearenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -55,12 +55,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_release
|
||||
* Name: env_release
|
||||
*
|
||||
* Description:
|
||||
* The env_release() function clears the environment of all name-value pairs
|
||||
* and sets the value of the external variable environ to NULL.
|
||||
|
||||
* The env_release() function clears the environment of all name-value
|
||||
* pairs and sets the value of the external variable environ to NULL.
|
||||
*
|
||||
* Parameters:
|
||||
* ptcb Identifies the TCB containing the environment structure
|
||||
*
|
||||
@@ -75,6 +75,7 @@
|
||||
int env_release(FAR _TCB *ptcb)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
if (!ptcb)
|
||||
{
|
||||
ret = -EINVAL;
|
||||
@@ -111,8 +112,10 @@ int env_release(FAR _TCB *ptcb)
|
||||
|
||||
ptcb->envp = NULL;
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/env_removevar.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -53,7 +53,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_removevar
|
||||
* Name: env_removevar
|
||||
*
|
||||
* Description:
|
||||
* Remove the referenced name=value pair from the environment
|
||||
@@ -109,6 +109,7 @@ int env_removevar(environ_t *envp, char *pvar)
|
||||
ret = OK;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@
|
||||
* sched/env_setenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -61,7 +61,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: setenv
|
||||
* Name: setenv
|
||||
*
|
||||
* Description:
|
||||
* The setenv() function adds the variable name to the environment with the
|
||||
@@ -148,8 +148,8 @@ int setenv(const char *name, const char *value, int overwrite)
|
||||
}
|
||||
|
||||
/* Get the size of the new name=value string. The +2 is for the '=' and for
|
||||
* null terminator
|
||||
*/
|
||||
* null terminator
|
||||
*/
|
||||
|
||||
varlen = strlen(name) + strlen(value) + 2;
|
||||
|
||||
|
||||
+4
-2
@@ -2,7 +2,7 @@
|
||||
* sched/env_share.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "env_internal.h"
|
||||
|
||||
@@ -55,7 +56,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: env_share
|
||||
* Name: env_share
|
||||
*
|
||||
* Description:
|
||||
* Increment the reference count on the internal environment structure of
|
||||
@@ -106,6 +107,7 @@ int env_share(FAR _TCB *ptcb)
|
||||
ptcb->envp = envp;
|
||||
sched_unlock();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/env_unsetenv.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -59,7 +59,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: unsetenv
|
||||
* Name: unsetenv
|
||||
*
|
||||
* Description:
|
||||
* The unsetenv() function deletes the variable name from the environment.
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/errno_get.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: get_errno
|
||||
* Name: get_errno
|
||||
*
|
||||
* Description:
|
||||
* Return the value of the thread specific errno. This function is only
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/errno_getptr.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -61,7 +61,7 @@ static int g_irqerrno;
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: get_errno_ptr
|
||||
* Name: get_errno_ptr
|
||||
*
|
||||
* Description:
|
||||
* Return a pointer to the thread specific errno.
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/errno_set.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -58,7 +58,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: set_errno
|
||||
* Name: set_errno
|
||||
*
|
||||
* Description:
|
||||
* Set the value of the thread specific errno. This function is only
|
||||
|
||||
+3
-1
@@ -43,7 +43,9 @@
|
||||
#include <unistd.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -75,7 +77,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: exit
|
||||
* Name: exit
|
||||
*
|
||||
* Description:
|
||||
* The exit() function causes normal process termination and the value of
|
||||
|
||||
+6
-5
@@ -2,7 +2,7 @@
|
||||
* sched/getpid.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
|
||||
/************************************************************************
|
||||
@@ -76,9 +77,9 @@
|
||||
|
||||
pid_t getpid(void)
|
||||
{
|
||||
/* Return the task ID from the TCB at the head of the
|
||||
* ready-to-run task list
|
||||
*/
|
||||
/* Return the task ID from the TCB at the head of the
|
||||
* ready-to-run task list
|
||||
*/
|
||||
|
||||
return ((FAR _TCB*)g_readytorun.head)->pid;
|
||||
return ((FAR _TCB*)g_readytorun.head)->pid;
|
||||
}
|
||||
|
||||
+4
-4
@@ -38,7 +38,9 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "irq_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -69,8 +71,8 @@
|
||||
* Name: irq_attach
|
||||
*
|
||||
* Description:
|
||||
* Configure the IRQ subsystem so that IRQ number 'irq'
|
||||
* is dispatched to 'isr'
|
||||
* Configure the IRQ subsystem so that IRQ number 'irq' is dispatched to
|
||||
* 'isr'
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -123,5 +125,3 @@ int irq_attach(int irq, xcpt_t isr)
|
||||
return OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/irq_dispatch.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -73,9 +73,9 @@
|
||||
* Name: irq_dispatch
|
||||
*
|
||||
* Description:
|
||||
* This function must be called from the achitecture-
|
||||
* specific logic in order to dispaly an interrupt to
|
||||
* the appropriate, registered handling logic.
|
||||
* This function must be called from the achitecture-specific logic in
|
||||
* order to dispatch an interrupt to the appropriate, registered handling
|
||||
* logic.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/irq_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007-2008, 2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "irq_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -69,7 +70,7 @@ FAR xcpt_t g_irqvector[NR_IRQS+1];
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: irq_initialize
|
||||
* Name: irq_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure the IRQ subsystem
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/irq_internal.h
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -33,8 +33,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __IRQ_INTERNAL_H
|
||||
#define __IRQ_INTERNAL_H
|
||||
#ifndef __SCHED_IRQ_INTERNAL_H
|
||||
#define __SCHED_IRQ_INTERNAL_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@@ -79,5 +79,5 @@ EXTERN int irq_unexpected_isr(int irq, FAR void *context);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __IRQ_INTERNAL_H */
|
||||
#endif /* __SCHED_IRQ_INTERNAL_H */
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/irq_unexpectedisr.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -38,8 +38,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "irq_internal.h"
|
||||
|
||||
@@ -68,11 +71,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: irq_unexpected_isr
|
||||
* Name: irq_unexpected_isr
|
||||
*
|
||||
* Description:
|
||||
* An interrupt has been received for an IRQ that was
|
||||
* never registered with the system.
|
||||
* An interrupt has been received for an IRQ that was never registered
|
||||
* with the system.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_addregion.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef void (*kmaddregion_t)(FAR void*, size_t);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kmm_addregion
|
||||
* Name: kmm_addregion
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space mm_addregion()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_initialize.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef void (*kminitialize_t)(FAR void*, size_t);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kmm_initialize
|
||||
* Name: kmm_initialize
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space mm_initialize()
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_kfree.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef void (*kfree_t)(FAR void *);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kfree
|
||||
* Name: kfree
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space free() function.
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_kmalloc.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef FAR void *(*kmalloc_t)(size_t);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kmalloc
|
||||
* Name: kmalloc
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space malloc() function.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_krealloc.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef FAR void *(*krealloc_t)(FAR void*, size_t);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: krealloc
|
||||
* Name: krealloc
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space realloc() function.
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_kzalloc.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -84,7 +84,7 @@ typedef FAR void *(*kzalloc_t)(size_t);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kzalloc
|
||||
* Name: kzalloc
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space zalloc() function.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* sched/kmm_semaphore.c
|
||||
*
|
||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -86,7 +86,7 @@ typedef void (*kmgivesemaphore_t)(void);
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
* Function: kmm_trysemaphore
|
||||
* Name: kmm_trysemaphore
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space mm_trysemaphore()
|
||||
@@ -112,7 +112,7 @@ int kmm_trysemaphore(void)
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* Function: kmm_givesemaphore
|
||||
* Name: kmm_givesemaphore
|
||||
*
|
||||
* Description:
|
||||
* This is a simple redirection to the user-space mm_givesemaphore()
|
||||
|
||||
+36
-38
@@ -1,8 +1,8 @@
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* sched/mq_close.c
|
||||
*
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,71 +31,69 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <mqueue.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "mq_internal.h"
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Global Variables
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Function: mq_desfree
|
||||
/****************************************************************************
|
||||
* Name: mq_desfree
|
||||
*
|
||||
* Description:
|
||||
* Deallocate a message queue descriptor but returning it
|
||||
* to the free liest
|
||||
* Deallocate a message queue descriptor but returning it to the free list
|
||||
*
|
||||
* Inputs:
|
||||
* mqdes - message queue descriptor to free
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define mq_desfree(mqdes) sq_addlast((FAR sq_entry_t*)mqdes, &g_desfree)
|
||||
|
||||
/************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************
|
||||
* Function: mq_close
|
||||
/****************************************************************************
|
||||
* Name: mq_close
|
||||
*
|
||||
* Description:
|
||||
* This function is used to indicate that the calling task
|
||||
* is finished with the specified message queued mqdes.
|
||||
* The mq_close() deallocates any system resources
|
||||
* allocated by the system for use by this task for its
|
||||
* message queue.
|
||||
* This function is used to indicate that the calling task is finished
|
||||
* with the specified message queued mqdes. The mq_close() deallocates
|
||||
* any system resources allocated by the system for use by this task for
|
||||
* its message queue.
|
||||
*
|
||||
* If the calling task has attached a notification to the
|
||||
* message queue via this mqdes, this attachment will be
|
||||
* removed and the message queue is available for another
|
||||
* process to attach a notification.
|
||||
* If the calling task has attached a notification to the message queue
|
||||
* via this mqdes, this attachment will be removed and the message queue
|
||||
* is available for another process to attach a notification.
|
||||
*
|
||||
* Parameters:
|
||||
* mqdes - Message queue descriptor.
|
||||
@@ -105,12 +103,12 @@
|
||||
* otherwise, -1 (ERROR).
|
||||
*
|
||||
* Assumptions:
|
||||
* - The behavior of a task that is blocked on either a mq_send()
|
||||
* or mq_receive is undefined when mq_close() is called.
|
||||
* - The results of using this message queue descriptor after a
|
||||
* a successful return from mq_close() is undefined.
|
||||
* - The behavior of a task that is blocked on either a mq_send() or
|
||||
* mq_receive() is undefined when mq_close() is called.
|
||||
* - The results of using this message queue descriptor after a successful
|
||||
* return from mq_close() is undefined.
|
||||
*
|
||||
************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int mq_close(mqd_t mqdes)
|
||||
{
|
||||
|
||||
+10
-7
@@ -2,7 +2,7 @@
|
||||
* sched/mq_descreate.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -39,19 +39,21 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdarg.h> /* va_list */
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <mqueue.h>
|
||||
#include <sched.h>
|
||||
#include <queue.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "sig_internal.h"
|
||||
|
||||
#include <queue.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include "mq_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -75,7 +77,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mq_desalloc
|
||||
* Name: mq_desalloc
|
||||
*
|
||||
* Description:
|
||||
* Allocate a message queue descriptor.
|
||||
@@ -117,7 +119,7 @@ static mqd_t mq_desalloc(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Function: mq_descreate
|
||||
* Name: mq_descreate
|
||||
*
|
||||
* Description:
|
||||
* Create a message queue descriptor for the specified TCB
|
||||
@@ -128,7 +130,8 @@ static mqd_t mq_desalloc(void)
|
||||
* oflags - access rights for the descriptor
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* On success, the message queue descriptor is returned. NULL is returned
|
||||
* on a failure to allocate.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user