user.c

来自「This a framework to test new ideas in tr」· C语言 代码 · 共 66 行

C
66
字号
/***************************************************************************             user.c  -  Implements all the necessary functions for user-space                            -------------------    begin                :  2002    authors              :  Linus Gasser    emails               :  linus.gasser@epfl.ch ***************************************************************************//***************************************************************************                                 Changes                                 ------- date - name - description 02-10-09 - ineiti- begin 02-12-09 - ineiti - added userprocfs  **************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************//** * This is the library a user-space-test program has to link against. * It offers all kinds of different functions that are available in * RTLinux kernel-space and that need to be emulated in user-space. * Have fun... */#include <stdlib.h>#include <dlfcn.h>#include "system.h"#include "user.h"#include "debugging.h"#define DBG_LVL 0void *bigphysarea_alloc_pages( int count, int align, int priority ) {  return malloc( count * PAGE_SIZE );}void bigphysarea_free_pages( void *base ) {  free( base );}int _init( void ) {  PR_DBG( 4, "Initialising user\n" );  return 0;}void _fini( void ) {  PR_DBG( 4, "Stopping user, cleaning up modules\n" );}EXPORT_SYMBOL(bigphysarea_alloc_pages);EXPORT_SYMBOL(bigphysarea_free_pages);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?