Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_io.c Create Date:2022-07-28 11:39:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kdb_handle_escape() - validity check on an accumulated escape sequence.*@buf: Accumulated escape characters to be examined. Note that buf* is not a string, it is an array of characters and need not be* nil terminated.

Proto:static int kdb_handle_escape(char *buf, size_t sz)

Type:int

Parameter:

TypeParameterName
char *buf
size_tsz
64  lastkey = buf + sz - 1
67  Case sz == 1
68  If lastkey == '\e' Then Return 0
70  Break
72  Case sz == 2
73  If lastkey == '[' Then Return 0
75  Break
77  Case sz == 3
79  Case lastkey == 'A'
80  Return 16
81  Case lastkey == 'B'
82  Return 14
83  Case lastkey == 'C'
84  Return 6
85  Case lastkey == 'D'
86  Return 2
87  Case lastkey == '1'
88  Case lastkey == '3'
89  Case lastkey == '4'
90  Return 0
92  Break
94  Case sz == 4
95  If lastkey == '~' Then
97  Case buf[2] == '1'
98  Return 1
99  Case buf[2] == '3'
100  Return 4
101  Case buf[2] == '4'
102  Return 5
105  Break
108  Return -1
Caller
NameDescribe
kdb_getcharkdb_getchar() - Read a single character from a kdb console (or consoles)