| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library zx; |
| |
| type ProfileInfoType = strict enum { |
| ZX_PROFILE_INFO_SCHEDULER = 1; |
| }; |
| |
| type ProfileScheduler = strict union { |
| 1: priority int32; |
| 2: boost uint32; |
| 3: deboost uint32; |
| 4: quantum uint32; |
| }; |
| |
| const ZX_PRIORITY_LOWEST int32 = 0; |
| const ZX_PRIORITY_LOW int32 = 8; |
| const ZX_PRIORITY_DEFAULT int32 = 16; |
| const ZX_PRIORITY_HIGH int32 = 24; |
| const ZX_PRIORITY_HIGHEST int32 = 31; |
| |
| type ProfileInfoData = strict union { |
| 1: scheduler ProfileScheduler; |
| }; |
| |
| type ProfileInfo = struct { |
| type ProfileInfoType; |
| // TODO(scottmg): This needs to be presented as an unnamed union in C, and |
| // ProfileInfoData doesn't really need a name. Not sure if the semantics of |
| // fidl unions make sense here. |
| unnamed ProfileInfoData; |
| }; |
| |
| @transport("Syscall") |
| protocol profile { |
| /// Create a scheduler profile. |
| /// Rights: root_job must be of type ZX_OBJ_TYPE_JOB and have ZX_RIGHT_MANAGE_PROCESS. |
| /// Rights: Caller job policy must allow ZX_POL_NEW_PROFILE. |
| profile_create(resource struct { |
| root_job handle:JOB; |
| options uint32; |
| profile ProfileInfo; |
| }) -> (resource struct { |
| status status; |
| out handle:PROFILE; |
| }); |
| }; |