github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/memory/memory_manager/vmm_stack.h (about)

     1  /*
     2   * Copyright (c) 2013 Intel Corporation
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *     http://www.apache.org/licenses/LICENSE-2.0
     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  
    15  #ifndef VMM_STACK_H
    16  #define VMM_STACK_H
    17  
    18  #ifdef DEBUG
    19  #define VMM_STACK_DEBUG_CODE
    20  #endif
    21  
    22  
    23  typedef struct VMM_STACKS_INFO_S {
    24      UINT64 stacks_base;
    25      UINT32 size_of_single_stack;
    26      UINT32 max_allowed_cpus;
    27      UINT32 num_of_exception_stacks;
    28      BOOLEAN is_initialized;
    29  } VMM_STACKS_INFO;
    30  
    31  INLINE UINT64 vmm_stacks_info_get_stacks_base(const VMM_STACKS_INFO* stacks_info) {
    32      return stacks_info->stacks_base;
    33  }
    34  
    35  INLINE void vmm_stacks_info_set_stacks_base(VMM_STACKS_INFO* stacks_info, UINT64 base) {
    36      stacks_info->stacks_base = base;
    37  }
    38  
    39  INLINE UINT32 vmm_stacks_info_get_size_of_single_stack(const VMM_STACKS_INFO* stacks_info) {
    40      return stacks_info->size_of_single_stack;
    41  }
    42  
    43  INLINE void vmm_stacks_info_set_size_of_single_stack(VMM_STACKS_INFO* stacks_info, UINT32 size) {
    44      stacks_info->size_of_single_stack = size;
    45  }
    46  
    47  INLINE UINT32 vmm_stacks_info_get_max_allowed_cpus(const VMM_STACKS_INFO* stacks_info) {
    48      return stacks_info->max_allowed_cpus;
    49  }
    50  
    51  INLINE void vmm_stacks_info_set_max_allowed_cpus(VMM_STACKS_INFO* stacks_info, UINT32 cpus_num) {
    52      stacks_info->max_allowed_cpus = cpus_num;
    53  }
    54  
    55  INLINE UINT32 vmm_stacks_info_get_num_of_exception_stacks(const VMM_STACKS_INFO* stacks_info) {
    56      return stacks_info->num_of_exception_stacks;
    57  }
    58  
    59  INLINE void vmm_stacks_info_set_num_of_exception_stacks(VMM_STACKS_INFO* stacks_info, UINT32 num_of_stacks) {
    60      stacks_info->num_of_exception_stacks = num_of_stacks;
    61  }
    62  
    63  INLINE BOOLEAN vmm_stacks_is_initialized(const VMM_STACKS_INFO* stacks_info) {
    64      return stacks_info->is_initialized;
    65  }
    66  
    67  INLINE void vmm_stacks_set_initialized(VMM_STACKS_INFO* stacks_info) {
    68      stacks_info->is_initialized = TRUE;
    69  }
    70  
    71  #endif