WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
console_pri.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
3 * Description: System Console Private HeadFile
4 * Author: Huawei LiteOS Team
5 * Create: 2022-04-02
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29#ifndef _CONSOLE_PRI_H
30#define _CONSOLE_PRI_H
31
32#include "console.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif /* __cplusplus */
37
38#ifdef LOSCFG_KERNEL_CONSOLE
39typedef struct {
40 Ringbuf ringbuf; /* Ring buffer */
41 EVENT_CB_S sendEvent; /* Inform telnet send task */
42} RingbufSendCB;
43
44typedef struct {
45 UINT32 consoleID;
46 UINT32 consoleType;
47 UINT32 consoleSem;
48 UINT32 shellEntryId;
49 UINT32 consoleMask;
50 struct inode *devInode;
51 CHAR *name;
52 INT32 fd;
53 UINT32 refCount;
54 BOOL isNonBlock;
55#ifdef LOSCFG_SHELL
56 VOID *shellHandle;
57#endif
58 UINT32 sendTaskID;
59 RingbufSendCB *ringbufSendCB;
61 UINT32 fifoOut;
62 UINT32 fifoIn;
63 UINT32 currentLen;
64 struct termios consoleTermios;
65} CONSOLE_CB;
66
67extern CONSOLE_CB *OsGetConsoleByID(INT32 consoleId);
68extern CONSOLE_CB *OsGetConsoleByTaskID(UINT32 taskId);
69extern UINT32 ConsoleTaskReg(INT32 consoleId, UINT32 taskId);
70extern BOOL is_nonblock(const CONSOLE_CB *consoleCB);
71extern BOOL IsConsoleOccupied(const CONSOLE_CB *consoleCB);
72
73extern BOOL OsConsoleIsEnabled(VOID);
74
75#ifdef LOSCFG_CONSOLE_UNIFIED_SERIAL_OUTPUT
76extern VOID OsConsoleDisable(VOID);
77#endif
78
79extern INT32 FilepOpen(struct file *filep, const struct file_operations_vfs *fops);
80extern INT32 FilepClose(struct file *filep, const struct file_operations_vfs *fops);
81extern INT32 FilepRead(struct file *filep, const struct file_operations_vfs *fops, CHAR *buffer, size_t bufLen);
82extern INT32 FilepWrite(struct file *filep, const struct file_operations_vfs *fops, const CHAR *buffer, size_t bufLen);
83extern INT32 FilepPoll(struct file *filep, const struct file_operations_vfs *fops, poll_table *fds);
84extern INT32 FilepIoctl(struct file *filep, const struct file_operations_vfs *fops, INT32 cmd, unsigned long arg);
85extern INT32 GetFilepOps(const struct file *filep, struct file **privFilep, const struct file_operations_vfs **fops);
86
88#else
90{
91 return -1;
92}
93#endif /* LOSCFG_KERNEL_CONSOLE */
94
95#ifdef __cplusplus
96}
97#endif /* __cplusplus */
98
99#endif /* _CONSOLE_PRI_H */
#define STATIC
Definition common_def.h:57
#define INLINE
Definition common_def.h:65
#define CONSOLE_FIFO_SIZE
Definition console.h:67
STATIC INLINE INT32 ConsoleUpdateFd(VOID)
Definition console_pri.h:89
signed int INT32
Definition los_typedef.h:55
#define VOID
Definition los_typedef.h:88
unsigned char UINT8
Definition los_typedef.h:50
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
size_t BOOL
Definition los_typedef.h:83
Definition los_ringbuf.h:67
Definition los_event.h:164