1 //
2 // Copyright (c) 2018 Antmicro
3 //
4 //  This file is licensed under the MIT License.
5 //  Full license text is available in 'licenses/MIT.txt'.
6 //
7 using System;
8 
9 namespace Antmicro.Renode.Peripherals.CPU
10 {
11     public enum CpuBitness
12     {
13         Bits32 = 32,
14         Bits64 = 64
15     }
16 
17     public static class CpuBitnessExtensions
18     {
GetMaxAddress(this CpuBitness @this)19         public static ulong GetMaxAddress(this CpuBitness @this)
20         {
21             switch(@this)
22             {
23             case CpuBitness.Bits32:
24                 return uint.MaxValue;
25             case CpuBitness.Bits64:
26                 return ulong.MaxValue;
27             default:
28                 throw new ArgumentException($"Unsupported cpu bitness encountered: {@this}");
29             }
30         }
31     }
32 }