| // 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. | 
 |  | 
 | // TODO(fxb/39732): This should be read as "library zx". | 
 | library zz; | 
 |  | 
 | enum ProfileInfoType { | 
 |     ZX_PROFILE_INFO_SCHEDULER = 1; | 
 | }; | 
 |  | 
 | union ProfileScheduler { | 
 |     1: int32 priority; | 
 |     2: uint32 boost; | 
 |     3: uint32 deboost; | 
 |     4: uint32 quantum; | 
 | }; | 
 |  | 
 | const int32 ZX_PRIORITY_LOWEST = 0; | 
 | const int32 ZX_PRIORITY_LOW = 8; | 
 | const int32 ZX_PRIORITY_DEFAULT = 16; | 
 | const int32 ZX_PRIORITY_HIGH = 24; | 
 | const int32 ZX_PRIORITY_HIGHEST = 31; | 
 |  | 
 | union ProfileInfoData { | 
 |     1: ProfileScheduler scheduler; | 
 | }; | 
 |  | 
 | struct ProfileInfo { | 
 |     ProfileInfoType type; | 
 |     // 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. | 
 |     ProfileInfoData unnamed; | 
 | }; | 
 |  | 
 | [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. | 
 |     profile_create(handle<job> root_job, uint32 options, ProfileInfo profile) | 
 |         -> (status status, handle<profile> out); | 
 | }; |