Thu Jan 19 08:03:22 2012 UTC ()
Improved true/false for cpu_rmixl?


(matt)
diff -r1.1.2.25 -r1.1.2.26 src/sys/arch/mips/rmi/rmixlvar.h

cvs diff -r1.1.2.25 -r1.1.2.26 src/sys/arch/mips/rmi/rmixlvar.h (expand / switch to unified diff)

--- src/sys/arch/mips/rmi/rmixlvar.h 2012/01/04 16:17:54 1.1.2.25
+++ src/sys/arch/mips/rmi/rmixlvar.h 2012/01/19 08:03:22 1.1.2.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rmixlvar.h,v 1.1.2.25 2012/01/04 16:17:54 matt Exp $ */ 1/* $NetBSD: rmixlvar.h,v 1.1.2.26 2012/01/19 08:03:22 matt Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Wasabi Systems, Inc. 4 * Copyright 2002 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Simon Burge for Wasabi Systems, Inc. 7 * Written by Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -57,47 +57,59 @@ cpu_rmixl_chip_type(const struct pridtab @@ -57,47 +57,59 @@ cpu_rmixl_chip_type(const struct pridtab
57 return ct->cpu_cidflags & MIPS_CIDFL_RMI_TYPE; 57 return ct->cpu_cidflags & MIPS_CIDFL_RMI_TYPE;
58} 58}
59 59
60static inline bool 60static inline bool
61cpu_rmixl(const struct pridtab *ct) 61cpu_rmixl(const struct pridtab *ct)
62{ 62{
63 return ct->cpu_cid == MIPS_PRID_CID_RMI; 63 return ct->cpu_cid == MIPS_PRID_CID_RMI;
64} 64}
65 65
66static inline bool 66static inline bool
67cpu_rmixlr(const struct pridtab *ct) 67cpu_rmixlr(const struct pridtab *ct)
68{ 68{
69#ifdef MIPS64_XLR 69#ifdef MIPS64_XLR
 70#if (MIPS64_XLS + MIPS64_XLP) == 0
 71 return true;
 72#else
70 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLR; 73 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLR;
 74#endif
71#else 75#else
72 return false; 76 return false;
73#endif 77#endif
74} 78}
75 79
76static inline bool 80static inline bool
77cpu_rmixls(const struct pridtab *ct) 81cpu_rmixls(const struct pridtab *ct)
78{ 82{
79#ifdef MIPS64_XLS 83#ifdef MIPS64_XLS
 84#if (MIPS64_XLR + MIPS64_XLP) == 0
 85 return true;
 86#else
80 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLS; 87 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLS;
 88#endif
81#else 89#else
82 return false; 90 return false;
83#endif 91#endif
84} 92}
85 93
86static inline bool 94static inline bool
87cpu_rmixlp(const struct pridtab *ct) 95cpu_rmixlp(const struct pridtab *ct)
88{ 96{
89#ifdef MIPS64_XLP 97#ifdef MIPS64_XLP
 98#if (MIPS64_XLR + MIPS64_XLS) == 0
 99 return true;
 100#else
90 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLP; 101 return cpu_rmixl(ct) && cpu_rmixl_chip_type(ct) == CIDFL_RMI_TYPE_XLP;
 102#endif
91#else 103#else
92 return false; 104 return false;
93#endif 105#endif
94} 106}
95 107
96typedef enum { 108typedef enum {
97 PSB_TYPE_UNKNOWN=0, 109 PSB_TYPE_UNKNOWN=0,
98 PSB_TYPE_RMI, 110 PSB_TYPE_RMI,
99 PSB_TYPE_DELL, 111 PSB_TYPE_DELL,
100} rmixlfw_psb_type_t; 112} rmixlfw_psb_type_t;
101 113
102static inline const char * 114static inline const char *
103rmixlfw_psb_type_name(rmixlfw_psb_type_t type) 115rmixlfw_psb_type_name(rmixlfw_psb_type_t type)