WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
osal_proc.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2022. All rights reserved.
3 * Description: OS Abstract Layer.
4 */
5
9#ifndef __OSAL_PROC_H__
10#define __OSAL_PROC_H__
11
12#include "osal_list.h"
13
14#ifdef __cplusplus
15#if __cplusplus
16extern "C" {
17#endif
18#endif
19
20#define OSAL_PROC_NAME_LENGTH 32
21#define PROC_CMD_SINGEL_LENGTH_MAX 32
22#define PROC_CMD_ALL_LENGTH_MAX 128
23#define PROC_CMD_NUM_MAX 16
24
25typedef struct osal_proc_cmd_ {
27 int (*handler)(unsigned int argc, char (*argv)[PROC_CMD_SINGEL_LENGTH_MAX], void *private_data);
29
30typedef struct osal_proc_dir_entry {
32 unsigned int cmd_cnt;
35 int (*open)(struct osal_proc_dir_entry *entry);
36 int (*read)(struct osal_proc_dir_entry *entry);
37 int (*write)(struct osal_proc_dir_entry *entry, const char *buf, int count, long long *);
39 void *seqfile;
42
59void osal_proc_init(const char *name);
60
72void osal_proc_exit(const char *name);
73
87void osal_remove_proc_entry(const char *name, osal_proc_entry *parent);
88
106
107#if defined(__LITEOS__)
108#define osal_seq_printf(seqfile, fmt, ...) seq_printf(seqfile, fmt, ##__VA_ARGS__)
109#else
110void osal_seq_printf(void *seqfile, const char *fmt, ...);
111#endif
112
113#ifdef __cplusplus
114#if __cplusplus
115}
116#endif
117#endif
118#endif /* __OSAL_PROC_H__ */
osal_proc_entry * osal_create_proc_entry(const char *name, osal_proc_entry *parent)
Create a file in the directory created by the function osal_proc_init.
void osal_proc_exit(const char *name)
Delete the directory created by osal_proc_init() and all the files in the directory.
void osal_proc_init(const char *name)
Create a directory in /proc.
void osal_remove_proc_entry(const char *name, osal_proc_entry *parent)
Delete the file created by the function osal_create_proc_entry.
#define PROC_CMD_SINGEL_LENGTH_MAX
Definition osal_proc.h:21
struct osal_proc_cmd_ osal_proc_cmd
#define osal_seq_printf(seqfile, fmt,...)
Definition osal_proc.h:108
#define OSAL_PROC_NAME_LENGTH
Definition osal_proc.h:20
struct osal_proc_dir_entry osal_proc_entry
Definition osal_list.h:39
Definition osal_proc.h:25
int(* handler)(unsigned int argc, char(*argv)[32], void *private_data)
Definition osal_proc.h:27
char name[32]
Definition osal_proc.h:26
Definition osal_proc.h:30
struct osal_list_head node
Definition osal_proc.h:40
void * private_data
Definition osal_proc.h:38
unsigned int cmd_cnt
Definition osal_proc.h:32
int(* write)(struct osal_proc_dir_entry *entry, const char *buf, int count, long long *)
Definition osal_proc.h:37
int(* read)(struct osal_proc_dir_entry *entry)
Definition osal_proc.h:36
void * proc_dir_entry
Definition osal_proc.h:34
char name[32]
Definition osal_proc.h:31
int(* open)(struct osal_proc_dir_entry *entry)
Definition osal_proc.h:35
void * seqfile
Definition osal_proc.h:39
osal_proc_cmd * cmd_list
Definition osal_proc.h:33