1 package com.tapina.robe.runtime;
2
3 import com.tapina.robe.runtime.RawDataBlock;
4
5 /***
6 * This class represents an operating system dynamic area definition.
7 *
8 * @author gareth
9 */
10 public final class DynamicArea extends RawDataBlock {
11 /*** Constant denoting area privileges - area is read/write */
12 public static final int READ_WRITE = 0;
13 /*** Constant denoting area privileges - area is read only */
14 public static final int READ_ONLY = 1;
15 /*** Constant denoting area privileges - area is inaccessible in User mode */
16 public static final int INACCESSIBLE = 2;
17 /*** Constant denoting area privileges - area is mapped out */
18 public static final int MAPPED_OUT = 3;
19
20 public static final int NOT_BUFFERABLE = 16;
21 public static final int NOT_CACHEABLE = 32;
22 public static final int DOUBLY_MAPPED = 64;
23 public static final int NOT_USER_RESIZABLE = 128;
24 public static final int REQUIRE_SPECIFIC_PAGES = 256;
25 public static final int SHRINKABLE = 512;
26 public static final int SPARSE = 1024;
27 public static final int BOUND = 2048;
28
29 private static int areaNumberSeq = 256;
30
31 private final int areaNumber;
32 private final int base;
33 private final int maximumSize;
34 private final int initialSize;
35 private final int handlerRoutine;
36 private final int handlerWorkspace;
37 private final String name;
38 private final int privileges;
39 private final int flags;
40
41 public DynamicArea(int base, int maximumSize, int initialSize, int handlerRoutine,
42 int handlerWorkspace, String name, int privileges, int flags) {
43 super(base, initialSize);
44 synchronized (DynamicArea.class) {
45 this.areaNumber = areaNumberSeq++;
46 }
47 this.base = base;
48 this.maximumSize = maximumSize;
49 this.initialSize = initialSize;
50 this.handlerRoutine = handlerRoutine;
51 this.handlerWorkspace = handlerWorkspace;
52 this.name = name;
53 this.privileges = privileges;
54 this.flags = flags;
55 }
56
57 public final int getAreaNumber() {
58 return areaNumber;
59 }
60
61 public final int getBase() {
62 return base;
63 }
64
65 public final int getMaximumSize() {
66 return maximumSize;
67 }
68
69 public final int getInitialSize() {
70 return initialSize;
71 }
72
73 public final int getHandlerRoutine() {
74 return handlerRoutine;
75 }
76
77 public final int getHandlerWorkspace() {
78 return handlerWorkspace;
79 }
80
81 public final String getName() {
82 return name;
83 }
84
85 public final int getPrivileges() {
86 return privileges;
87 }
88
89 public final int getFlags() {
90 return flags;
91 }
92 }