2019-08-26 00:58:43 +02:00
|
|
|
/****************************************************************************
|
2021-03-08 22:39:04 +01:00
|
|
|
* libs/libc/builtin/lib_builtin_setlist.c
|
2019-08-26 00:58:43 +02:00
|
|
|
*
|
2021-03-31 13:42:08 +02: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
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* 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.
|
2019-08-26 00:58:43 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <nuttx/lib/builtin.h>
|
|
|
|
|
2022-02-13 13:07:18 +01:00
|
|
|
#if defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)
|
2019-08-26 00:58:43 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-08-26 02:37:23 +02:00
|
|
|
FAR const struct builtin_s *g_builtins;
|
2019-08-26 00:58:43 +02:00
|
|
|
int g_builtin_count;
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: builtin_setlist
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Saves the user-space list of built-in applications for use by BINFS in
|
|
|
|
* protected mode. Normally this is small set of globals provided by
|
|
|
|
* user-space logic. It provides name-value pairs for associating
|
|
|
|
* built-in application names with user-space entry point addresses.
|
|
|
|
* These globals are only needed for use by BINFS which executes built-in
|
|
|
|
* applications from kernel-space in PROTECTED mode. In the FLAT build,
|
|
|
|
* the user space globals are readily available. (BINFS is not
|
|
|
|
* supportable in KERNEL mode since user-space address have no general
|
|
|
|
* meaning that configuration).
|
|
|
|
*
|
|
|
|
* Input Parameters:
|
|
|
|
* builtins - The list of built-in functions. Each entry is a name-value
|
2019-09-11 20:37:29 +02:00
|
|
|
* pair that maps a built-in function name to its user-space
|
2019-08-26 00:58:43 +02:00
|
|
|
* entry point address.
|
2019-09-11 20:37:29 +02:00
|
|
|
* count - The number of name-value pairs in the built-in list.
|
2019-08-26 00:58:43 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-08-26 02:37:23 +02:00
|
|
|
void builtin_setlist(FAR const struct builtin_s *builtins, int count)
|
2019-08-26 00:58:43 +02:00
|
|
|
{
|
2019-08-26 01:37:13 +02:00
|
|
|
g_builtins = builtins;
|
|
|
|
g_builtin_count = count;
|
2019-08-26 00:58:43 +02:00
|
|
|
}
|
|
|
|
|
2022-02-13 13:07:18 +01:00
|
|
|
#endif /* CONFIG_BUILD_PROTECTED && __KERNEL__ */
|