Move stream data from TCB to task group structure.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5569 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
43659b5840
commit
6cfe0a45e9
@ -75,7 +75,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -83,40 +87,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,7 +75,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -83,40 +87,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,7 +75,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -83,40 +87,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -77,7 +77,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,40 +89,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,7 +76,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -84,40 +88,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* common/up_exit.c
|
* common/up_exit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -75,7 +75,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -83,40 +87,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
sdbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
sdbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
sdbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
sdbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
sdbg(" fd=%d nbytes=%d\n",
|
sdbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
sdbg(" fd=%d\n", filep->fs_filedes);
|
sdbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -77,7 +77,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -85,40 +89,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
lldbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
lldbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
lldbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
lldbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
lldbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
lldbg(" fd=%d nbytes=%d\n",
|
lldbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
lldbg(" fd=%d\n", filep->fs_filedes);
|
lldbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* common/up_exit.c
|
* common/up_exit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -78,7 +78,11 @@
|
|||||||
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_DUMP_ON_EXIT) && defined(CONFIG_DEBUG)
|
||||||
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
|
FAR struct filelist *filelist;
|
||||||
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
|
FAR struct streamlist *streamlist;
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -86,40 +90,32 @@ static void _up_dumponexit(FAR _TCB *tcb, FAR void *arg)
|
|||||||
lldbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
lldbg(" priority=%d state=%d\n", tcb->sched_priority, tcb->task_state);
|
||||||
|
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
if (tcb->filelist)
|
filelist = tcb->group->tg_filelist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
||||||
{
|
{
|
||||||
FAR struct filelist *list = tcb->group->tg_filelist;
|
struct inode *inode = filelist->fl_files[i].f_inode;
|
||||||
for (i = 0; i < CONFIG_NFILE_DESCRIPTORS; i++)
|
if (inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = list->fl_files[i].f_inode;
|
lldbg(" fd=%d refcount=%d\n",
|
||||||
if (inode)
|
i, inode->i_crefs);
|
||||||
{
|
|
||||||
lldbg(" fd=%d refcount=%d\n",
|
|
||||||
i, inode->i_crefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_NFILE_STREAMS > 0
|
#if CONFIG_NFILE_STREAMS > 0
|
||||||
if (tcb->streams)
|
streamlist = tcb->group->tg_streamlist;
|
||||||
|
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||||
{
|
{
|
||||||
lldbg(" streamlist refcount=%d\n",
|
struct file_struct *filep = &streamlist->sl_streams[i];
|
||||||
tcb->streams->sl_crefs);
|
if (filep->fs_filedes >= 0)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
|
||||||
{
|
{
|
||||||
struct file_struct *filep = &tcb->streams->sl_streams[i];
|
|
||||||
if (filep->fs_filedes >= 0)
|
|
||||||
{
|
|
||||||
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
#if CONFIG_STDIO_BUFFER_SIZE > 0
|
||||||
lldbg(" fd=%d nbytes=%d\n",
|
lldbg(" fd=%d nbytes=%d\n",
|
||||||
filep->fs_filedes,
|
filep->fs_filedes,
|
||||||
filep->fs_bufpos - filep->fs_bufstart);
|
filep->fs_bufpos - filep->fs_bufstart);
|
||||||
#else
|
#else
|
||||||
lldbg(" fd=%d\n", filep->fs_filedes);
|
lldbg(" fd=%d\n", filep->fs_filedes);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user