2010-08-14 03:56:13 +02:00
|
|
|
/****************************************************************************
|
2014-08-08 23:08:07 +02:00
|
|
|
* sched/paging/paging.h
|
2010-08-14 03:56:13 +02:00
|
|
|
*
|
2024-09-11 13:45:11 +02:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-08 16:33:58 +01: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 03:56:13 +02:00
|
|
|
*
|
2021-02-08 16:33:58 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2010-08-14 03:56:13 +02:00
|
|
|
*
|
2021-02-08 16:33:58 +01: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 03:56:13 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-08-08 23:08:07 +02:00
|
|
|
#ifndef __SCHED_PAGING_PAGING_H
|
|
|
|
#define __SCHED_PAGING_PAGING_H
|
2010-08-14 03:56:13 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
2014-04-13 22:32:20 +02:00
|
|
|
|
2010-08-14 03:56:13 +02:00
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
2023-03-24 21:12:41 +01:00
|
|
|
#include <signal.h>
|
|
|
|
|
2024-02-29 20:21:23 +01:00
|
|
|
#ifdef CONFIG_LEGACY_PAGING
|
2010-08-14 03:56:13 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
2015-04-08 14:47:36 +02:00
|
|
|
* Pre-processor Definitions
|
2010-08-14 03:56:13 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Configuration ************************************************************/
|
|
|
|
|
2010-08-15 17:02:45 +02: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 03:56:13 +02:00
|
|
|
#endif
|
|
|
|
|
2010-08-15 17:02:45 +02:00
|
|
|
#ifndef CONFIG_PAGING_STACKSIZE
|
|
|
|
# define CONFIG_PAGING_STACKSIZE CONFIG_IDLETHREAD_STACKSIZE
|
2010-08-14 03:56:13 +02:00
|
|
|
#endif
|
|
|
|
|
2023-03-24 21:12:41 +01:00
|
|
|
#define SIGPAGING SIGRTMIN
|
|
|
|
|
2010-08-14 03:56:13 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY
|
|
|
|
|
2010-08-15 17:02:45 +02:00
|
|
|
/* This is the task IDof the page fill worker thread. This value was set in
|
2019-02-04 23:20:35 +01:00
|
|
|
* nx_start when the page fill worker thread was started.
|
2010-08-15 17:02:45 +02:00
|
|
|
*/
|
2010-08-14 03:56:13 +02:00
|
|
|
|
|
|
|
extern pid_t g_pgworker;
|
|
|
|
|
2010-08-15 18:50:25 +02: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 09:50:23 +01:00
|
|
|
* in progress.
|
2010-08-15 17:02:45 +02: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 03:56:13 +02:00
|
|
|
|
2013-02-04 19:46:28 +01:00
|
|
|
extern FAR struct tcb_s *g_pftcb;
|
2010-08-14 03:56:13 +02: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-01 17:00:02 +01:00
|
|
|
* Input Parameters:
|
2010-08-14 03:56:13 +02:00
|
|
|
* argc, argv (not used)
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Does not return
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2023-03-26 11:54:19 +02:00
|
|
|
int pg_worker(int argc, FAR char *argv[]);
|
2010-08-14 03:56:13 +02:00
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
2024-02-29 20:21:23 +01:00
|
|
|
#endif /* CONFIG_LEGACY_PAGING */
|
2014-08-08 23:08:07 +02:00
|
|
|
#endif /* __SCHED_PAGING_PAGING_H */
|