1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
--- 43 unchanged lines hidden (view full) ---
52 {
53 U, User = U,
54 P, Privileged = P,
55 H, Hyperprivileged = H,
56 NumLevels,
57 SH = -1,
58 ShouldntHappen = SH
59 };
60 using PrivilegeLevelSpec = std::array<PrivilegeLevel, NumLevels>;
61 struct FaultVals
62 {
63 const FaultName name;
64 const TrapType trapType;
65 const FaultPriority priority;
66 const PrivilegeLevelSpec nextPrivilegeLevel;
67 FaultStat count;
68 FaultVals(const FaultName& name_, const TrapType& trapType_,
69 const FaultPriority& priority_, const PrivilegeLevelSpec& il)
70 : name(name_), trapType(trapType_), priority(priority_),
71 nextPrivilegeLevel(il)
72 {}
73 };
74 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
75 StaticInst::nullStaticInstPtr);
76 virtual TrapType trapType() = 0;
77 virtual FaultPriority priority() = 0;
78 virtual FaultStat & countStat() = 0;
79 virtual PrivilegeLevel getNextLevel(PrivilegeLevel current) = 0;
80};
--- 286 unchanged lines hidden ---
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
--- 43 unchanged lines hidden (view full) ---
52 {
53 U, User = U,
54 P, Privileged = P,
55 H, Hyperprivileged = H,
56 NumLevels,
57 SH = -1,
58 ShouldntHappen = SH
59 };
60 using PrivilegeLevelSpec = std::array<PrivilegeLevel, NumLevels>;
61 struct FaultVals
62 {
63 const FaultName name;
64 const TrapType trapType;
65 const FaultPriority priority;
66 const PrivilegeLevelSpec nextPrivilegeLevel;
67 FaultStat count;
68 FaultVals(const FaultName& name_, const TrapType& trapType_,
69 const FaultPriority& priority_, const PrivilegeLevelSpec& il)
70 : name(name_), trapType(trapType_), priority(priority_),
71 nextPrivilegeLevel(il)
72 {}
73 };
74 void invoke(ThreadContext * tc, const StaticInstPtr &inst =
75 StaticInst::nullStaticInstPtr);
76 virtual TrapType trapType() = 0;
77 virtual FaultPriority priority() = 0;
78 virtual FaultStat & countStat() = 0;
79 virtual PrivilegeLevel getNextLevel(PrivilegeLevel current) = 0;
80};
--- 286 unchanged lines hidden ---