utility.hh (12334:e0ab29a34764) utility.hh (13615:5cc9363f5ab7)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 60 unchanged lines hidden (view full) ---

69
70bool isNan(void *val_ptr, int size);
71bool isQnan(void *val_ptr, int size);
72bool isSnan(void *val_ptr, int size);
73
74static inline bool
75inUserMode(ThreadContext *tc)
76{
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2007 MIPS Technologies, Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 60 unchanged lines hidden (view full) ---

69
70bool isNan(void *val_ptr, int size);
71bool isQnan(void *val_ptr, int size);
72bool isSnan(void *val_ptr, int size);
73
74static inline bool
75inUserMode(ThreadContext *tc)
76{
77 MiscReg Stat = tc->readMiscReg(MISCREG_STATUS);
78 MiscReg Dbg = tc->readMiscReg(MISCREG_DEBUG);
77 RegVal Stat = tc->readMiscReg(MISCREG_STATUS);
78 RegVal Dbg = tc->readMiscReg(MISCREG_DEBUG);
79
80 if ((Stat & 0x10000006) == 0 && // EXL, ERL or CU0 set, CP0 accessible
81 (Dbg & 0x40000000) == 0 && // DM bit set, CP0 accessible
82 (Stat & 0x00000018) != 0) { // KSU = 0, kernel mode is base mode
83 // Unable to use Status_CU0, etc directly, using bitfields & masks
84 return true;
85 } else {
86 return false;

--- 46 unchanged lines hidden ---
79
80 if ((Stat & 0x10000006) == 0 && // EXL, ERL or CU0 set, CP0 accessible
81 (Dbg & 0x40000000) == 0 && // DM bit set, CP0 accessible
82 (Stat & 0x00000018) != 0) { // KSU = 0, kernel mode is base mode
83 // Unable to use Status_CU0, etc directly, using bitfields & masks
84 return true;
85 } else {
86 return false;

--- 46 unchanged lines hidden ---