1 // Copyright (C) 2024 Huawei Device Co., Ltd.
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 enum Shift {
15     Critical = 0,
16     High,
17     Normal,
18     Default,
19     Proto,
20 }
21 
22 const DUMP_FLAG_PRIORITY_CRITICAL: u32 = 1 << Shift::Critical as usize;
23 const DUMP_FLAG_PRIORITY_HIGH: u32 = 1 << Shift::High as usize;
24 const DUMP_FLAG_PRIORITY_NORMAL: u32 = 1 << Shift::Normal as usize;
25 
26 const DUMP_FLAG_PRIORITY_DEFAULT: u32 = 1 << Shift::Default as usize;
27 const DUMP_FLAG_PRIORITY_ALL: u32 = DUMP_FLAG_PRIORITY_CRITICAL
28     | DUMP_FLAG_PRIORITY_HIGH
29     | DUMP_FLAG_PRIORITY_NORMAL
30     | DUMP_FLAG_PRIORITY_DEFAULT;
31 const DUMP_FLAG_PROTO: u32 = 1 << Shift::Proto as usize;
32 
33 #[repr(u32)]
34 pub enum DumpFlagPriority {
35     Critical = DUMP_FLAG_PRIORITY_CRITICAL,
36     High = DUMP_FLAG_PRIORITY_HIGH,
37     Normal = DUMP_FLAG_PRIORITY_NORMAL,
38     Default = DUMP_FLAG_PRIORITY_DEFAULT,
39     All = DUMP_FLAG_PRIORITY_ALL,
40     Proto = DUMP_FLAG_PROTO,
41 }
42