Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复编译过程中的 DFS_V2报错、FAL警告 #9806

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
9 changes: 5 additions & 4 deletions components/dfs/dfs_v2/src/dfs_pcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
#include <dfs_pcache.h>
#include <dfs_dentry.h>
#include <dfs_mnt.h>
#include <mm_page.h>
#include <mm_private.h>
#include <mmu.h>
#include <tlb.h>

#include <rthw.h>

#ifdef RT_USING_PAGECACHE

#include <mm_page.h>
#include <mm_private.h>
#include <mmu.h>
#include <tlb.h>

#ifndef RT_PAGECACHE_COUNT
#define RT_PAGECACHE_COUNT 4096
#endif
Expand Down
6 changes: 3 additions & 3 deletions components/drivers/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include <rtdevice.h> /* for wqueue_init */
#endif /* RT_USING_POSIX_DEVIO */

#ifdef RT_USING_DFS_V2
#if defined (RT_USING_DFS_V2) && defined (RT_USING_DFS_DEVFS)
#include <devfs.h>
#endif /* RT_USING_DFS_V2 */
#endif /* RT_USING_DFS_V2 RT_USING_DFS_DEVFS */

#ifdef RT_USING_DEVICE

Expand Down Expand Up @@ -84,7 +84,7 @@ rt_err_t rt_device_register(rt_device_t dev,
rt_wqueue_init(&(dev->wait_queue));
#endif /* RT_USING_POSIX_DEVIO */

#ifdef RT_USING_DFS_V2
#if defined (RT_USING_DFS_V2) && defined (RT_USING_DFS_DEVFS)
dfs_devfs_device_add(dev);
#endif /* RT_USING_DFS_V2 */

Expand Down
104 changes: 66 additions & 38 deletions components/drivers/include/drivers/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ enum
};

/* The name of all modes used in the msh command "pm_dump" */
#define PM_SLEEP_MODE_NAMES \
{ \
"None Mode", \
"Idle Mode", \
"LightSleep Mode", \
"DeepSleep Mode", \
"Standby Mode", \
"Shutdown Mode", \
}

#define PM_RUN_MODE_NAMES \
{ \
"High Speed", \
"Normal Speed", \
"Medium Speed", \
"Low Mode", \
}
#define PM_SLEEP_MODE_NAMES \
{ \
"None Mode", \
"Idle Mode", \
"LightSleep Mode", \
"DeepSleep Mode", \
"Standby Mode", \
"Shutdown Mode", \
}

#define PM_RUN_MODE_NAMES \
{ \
"High Speed", \
"Normal Speed", \
"Medium Speed", \
"Low Mode", \
}

#ifndef PM_USING_CUSTOM_CONFIG
/**
Expand All @@ -74,7 +74,8 @@ enum
* pm_module_release(PM_BOARD_ID, PM_SLEEP_MODE_IDLE)
* pm_module_release_all(PM_BOARD_ID, PM_SLEEP_MODE_IDLE)
*/
enum pm_module_id {
enum pm_module_id
{
PM_NONE_ID = 0,
PM_POWER_ID,
PM_BOARD_ID,
Expand Down Expand Up @@ -102,22 +103,22 @@ enum pm_module_id {
#endif /* PM_USING_CUSTOM_CONFIG */

#ifndef RT_PM_DEFAULT_SLEEP_MODE
#define RT_PM_DEFAULT_SLEEP_MODE PM_SLEEP_MODE_NONE
#define RT_PM_DEFAULT_SLEEP_MODE PM_SLEEP_MODE_NONE
#endif

#ifndef RT_PM_DEFAULT_DEEPSLEEP_MODE
#define RT_PM_DEFAULT_DEEPSLEEP_MODE PM_SLEEP_MODE_DEEP
#define RT_PM_DEFAULT_DEEPSLEEP_MODE PM_SLEEP_MODE_DEEP
#endif

#ifndef RT_PM_DEFAULT_RUN_MODE
#define RT_PM_DEFAULT_RUN_MODE PM_RUN_MODE_NORMAL_SPEED
#define RT_PM_DEFAULT_RUN_MODE PM_RUN_MODE_NORMAL_SPEED
#endif

/**
* device control flag to request or release power
*/
#define RT_PM_DEVICE_CTRL_RELEASE (RT_DEVICE_CTRL_BASE(PM) + 0x00)
#define RT_PM_DEVICE_CTRL_REQUEST (RT_DEVICE_CTRL_BASE(PM) + 0x01)
#define RT_PM_DEVICE_CTRL_RELEASE (RT_DEVICE_CTRL_BASE(PM) + 0x00)
#define RT_PM_DEVICE_CTRL_REQUEST (RT_DEVICE_CTRL_BASE(PM) + 0x01)

struct rt_pm;

Expand All @@ -142,15 +143,15 @@ struct rt_device_pm_ops

struct rt_device_pm
{
const struct rt_device *device;
const struct rt_device *device;
const struct rt_device_pm_ops *ops;
rt_slist_t list;
rt_slist_t list;
};

struct rt_pm_module
{
rt_uint8_t req_status;
rt_bool_t busy_flag;
rt_uint8_t req_status;
rt_bool_t busy_flag;
rt_uint32_t timeout;
rt_uint32_t start_time;
};
Expand All @@ -164,17 +165,18 @@ struct rt_pm

/* modes */
rt_uint8_t modes[PM_SLEEP_MODE_MAX];
rt_uint8_t sleep_mode; /* current sleep mode */
rt_uint8_t run_mode; /* current running mode */
rt_uint8_t sleep_mode; /* current sleep mode */
rt_uint8_t run_mode; /* current running mode */

#ifndef PM_DISABLE_MODULE
/* modules request status*/
struct rt_pm_module module_status[PM_MODULE_MAX_ID];

/* sleep request table */
rt_uint32_t sleep_status[PM_SLEEP_MODE_MAX - 1][(PM_MODULE_MAX_ID + 31) / 32];
#endif

/* the list of device, which has PM feature */
rt_slist_t device_list;
rt_slist_t device_list;
struct rt_device_pm *device_pm;

/* if the mode has timer, the corresponding bit is 1*/
Expand Down Expand Up @@ -209,18 +211,44 @@ void rt_pm_default_set(rt_uint8_t sleep_mode);

void rt_system_pm_init(const struct rt_pm_ops *ops,
rt_uint8_t timer_mask,
void *user_data);
rt_err_t rt_pm_module_request(uint8_t module_id, rt_uint8_t sleep_mode);
rt_err_t rt_pm_module_release(uint8_t module_id, rt_uint8_t sleep_mode);
rt_err_t rt_pm_module_release_all(uint8_t module_id, rt_uint8_t sleep_mode);
void rt_pm_module_delay_sleep(rt_uint8_t module_id, rt_tick_t timeout);
rt_uint32_t rt_pm_module_get_status(void);
rt_uint8_t rt_pm_get_sleep_mode(void);
void *user_data);

rt_uint8_t rt_pm_get_sleep_mode(void);
struct rt_pm *rt_pm_get_handle(void);

#ifndef PM_DISABLE_MODULE
rt_err_t rt_pm_module_request(rt_uint16_t module_id, rt_uint8_t sleep_mode);
rt_err_t rt_pm_module_release(rt_uint16_t module_id, rt_uint8_t sleep_mode);
rt_err_t rt_pm_module_release_all(rt_uint16_t module_id, rt_uint8_t sleep_mode);
void rt_pm_module_delay_sleep(rt_uint16_t module_id, rt_tick_t timeout);
rt_uint32_t rt_pm_module_get_status(void);

/* sleep : request or release */
rt_err_t rt_pm_sleep_request(rt_uint16_t module_id, rt_uint8_t mode);
rt_err_t rt_pm_sleep_release(rt_uint16_t module_id, rt_uint8_t mode);

#else

rt_inline rt_err_t rt_pm_module_request(rt_uint16_t module_id, rt_uint8_t sleep_mode)
{
RT_UNUSED(module_id);
return rt_pm_request(sleep_mode);
}
rt_inline rt_err_t rt_pm_module_release(rt_uint16_t module_id, rt_uint8_t sleep_mode)
{
RT_UNUSED(module_id);
return rt_pm_release(sleep_mode);
}
rt_inline rt_err_t rt_pm_module_release_all(rt_uint16_t module_id, rt_uint8_t sleep_mode)
{
RT_UNUSED(module_id);
return rt_pm_release_all(sleep_mode);
}
#define rt_pm_sleep_request(module_id, mode) rt_pm_request(mode)
#define rt_pm_sleep_release(module_id, mode) rt_pm_release(mode)

#endif

rt_err_t rt_pm_sleep_none_request(rt_uint16_t module_id);
rt_err_t rt_pm_sleep_none_release(rt_uint16_t module_id);
rt_err_t rt_pm_sleep_idle_request(rt_uint16_t module_id);
Expand Down
4 changes: 3 additions & 1 deletion components/drivers/include/ipc/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <rtdef.h>
#include <rtconfig.h>
#include "completion.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -42,6 +43,7 @@ struct rt_workqueue
struct rt_semaphore sem;
rt_thread_t work_thread;
struct rt_spinlock spinlock;
struct rt_completion wakeup_completion;
};

struct rt_work
Expand All @@ -52,7 +54,7 @@ struct rt_work
void *work_data;
rt_uint16_t flags;
rt_uint16_t type;
struct rt_timer timer;
rt_tick_t timeout_tick;
struct rt_workqueue *workqueue;
};

Expand Down
Loading
Loading