2010-08-14 09:56:13 +08:00
|
|
|
/****************************************************************************
|
2014-08-09 05:08:07 +08:00
|
|
|
* sched/paging/paging.h
|
2010-08-14 09:56:13 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2010-08-14 09:56:13 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2010-08-14 09:56:13 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2010-08-14 09:56:13 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-08-09 05:08:07 +08:00
|
|
|
#ifndef __SCHED_PAGING_PAGING_H
|
|
|
|
#define __SCHED_PAGING_PAGING_H
|
2010-08-14 09:56:13 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
2014-04-14 04:32:20 +08:00
|
|
|
|
2010-08-14 09:56:13 +08:00
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#ifdef CONFIG_PAGING
|
|
|
|
|
|
|
|
/****************************************************************************
|
2015-04-08 20:47:36 +08:00
|
|
|
* Pre-processor Definitions
|
2010-08-14 09:56:13 +08:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Configuration ************************************************************/
|
|
|
|
|
2010-08-15 23:02:45 +08:00
|
|
|
/* Supply reasonable (but probably non-optimal) default settings if
|
|
|
|
* configuration items are omitted.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIG_PAGING_DEFPRIO
|
|
|
|
# define CONFIG_PAGING_DEFPRIO 50
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CONFIG_PAGING_WORKPERIOD
|
|
|
|
# define CONFIG_PAGING_WORKPERIOD (500*1000) /* 1/2 second */
|
2010-08-14 09:56:13 +08:00
|
|
|
#endif
|
|
|
|
|
2010-08-15 23:02:45 +08:00
|
|
|
#ifndef CONFIG_PAGING_STACKSIZE
|
|
|
|
# define CONFIG_PAGING_STACKSIZE CONFIG_IDLETHREAD_STACKSIZE
|
2010-08-14 09:56:13 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY
|
|
|
|
|
2010-08-15 23:02:45 +08:00
|
|
|
/* This is the task IDof the page fill worker thread. This value was set in
|
2019-02-05 06:20:35 +08:00
|
|
|
* nx_start when the page fill worker thread was started.
|
2010-08-15 23:02:45 +08:00
|
|
|
*/
|
2010-08-14 09:56:13 +08:00
|
|
|
|
|
|
|
extern pid_t g_pgworker;
|
|
|
|
|
2010-08-16 00:50:25 +08:00
|
|
|
/* The page fill worker thread maintains a static variable called g_pftcb.
|
|
|
|
* If no page fill is in progress, g_pftcb will be NULL. Otherwise, g_pftcb
|
|
|
|
* will point to the TCB of the task which is receiving the fill that is
|
2020-02-23 16:50:23 +08:00
|
|
|
* in progress.
|
2010-08-15 23:02:45 +08:00
|
|
|
*
|
|
|
|
* NOTE: I think that this is the only state in which a TCB does not reside
|
|
|
|
* in some list. Here is it in limbo, outside of the normally queuing while
|
|
|
|
* the page file is in progress. Where here, it will be marked with
|
|
|
|
* TSTATE_TASK_INVALID.
|
|
|
|
*/
|
2010-08-14 09:56:13 +08:00
|
|
|
|
2013-02-05 02:46:28 +08:00
|
|
|
extern FAR struct tcb_s *g_pftcb;
|
2010-08-14 09:56:13 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: pg_worker
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* This is the entry point of the worker thread that performs the actual
|
|
|
|
* page file.
|
|
|
|
*
|
2018-02-02 00:00:02 +08:00
|
|
|
* Input Parameters:
|
2010-08-14 09:56:13 +08:00
|
|
|
* argc, argv (not used)
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Does not return
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-07-15 03:30:31 +08:00
|
|
|
int pg_worker(int argc, char *argv[]);
|
2010-08-14 09:56:13 +08:00
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* CONFIG_PAGING */
|
2014-08-09 05:08:07 +08:00
|
|
|
#endif /* __SCHED_PAGING_PAGING_H */
|