mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fab1eefc1 | ||
|
|
27a0c42190 |
352
LICENSE
352
LICENSE
@@ -1,339 +1,21 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
MIT License
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
Copyright (c) 2018 Dr-Noob
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The above copyright notice and this permission notice shall be included in all
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
copies or substantial portions of the Software.
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Lesser General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
have the freedom to distribute copies of free software (and charge for
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
this service if you wish), that you receive source code or can get it
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
if you want it, that you can change the software or use pieces of it
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
in new free programs; and that you know you can do these things.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
convey the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along
|
|
||||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program is interactive, make it output a short notice like this
|
|
||||||
when it starts in an interactive mode:
|
|
||||||
|
|
||||||
Gnomovision version 69, Copyright (C) year name of author
|
|
||||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
This General Public License does not permit incorporating your program into
|
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
|
||||||
consider it more useful to permit linking proprietary applications with the
|
|
||||||
library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License.
|
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -70,13 +70,13 @@ static: $(OUTPUT)
|
|||||||
strict: CFLAGS += -O2 -Werror -fsanitize=undefined -D_FORTIFY_SOURCE=2
|
strict: CFLAGS += -O2 -Werror -fsanitize=undefined -D_FORTIFY_SOURCE=2
|
||||||
strict: $(OUTPUT)
|
strict: $(OUTPUT)
|
||||||
|
|
||||||
freq_nov.o: Makefile $(SRC_DIR)freq/freq_nov.c $(SRC_DIR)freq/freq_nov.h $(SRC_DIR)freq/freq.h
|
freq_nov.o: Makefile $(SRC_DIR)freq/freq_nov.c $(SRC_DIR)freq/freq_nov.h
|
||||||
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -pthread $(SRC_DIR)freq/freq_nov.c -o $@
|
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -pthread $(SRC_DIR)freq/freq_nov.c -o $@
|
||||||
|
|
||||||
freq_avx.o: Makefile $(SRC_DIR)freq/freq_avx.c $(SRC_DIR)freq/freq_avx.h $(SRC_DIR)freq/freq.h
|
freq_avx.o: Makefile $(SRC_DIR)freq/freq_avx.c $(SRC_DIR)freq/freq_avx.h
|
||||||
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -mavx -pthread $(SRC_DIR)freq/freq_avx.c -o $@
|
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -mavx -pthread $(SRC_DIR)freq/freq_avx.c -o $@
|
||||||
|
|
||||||
freq_avx512.o: Makefile $(SRC_DIR)freq/freq_avx512.c $(SRC_DIR)freq/freq_avx512.h $(SRC_DIR)freq/freq.h
|
freq_avx512.o: Makefile $(SRC_DIR)freq/freq_avx512.c $(SRC_DIR)freq/freq_avx512.h
|
||||||
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -mavx512f -pthread $(SRC_DIR)freq/freq_avx512.c -o $@
|
$(CC) $(CFLAGS) $(SANITY_FLAGS) -c -mavx512f -pthread $(SRC_DIR)freq/freq_avx512.c -o $@
|
||||||
|
|
||||||
$(OUTPUT): Makefile $(SOURCE) $(HEADERS)
|
$(OUTPUT): Makefile $(SOURCE) $(HEADERS)
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
#elif defined __APPLE__ || __MACH__
|
#elif defined __APPLE__ || __MACH__
|
||||||
#include "sysctl.h"
|
#include "sysctl.h"
|
||||||
|
// From Linux kernel: arch/arm64/include/asm/cputype.h
|
||||||
|
#define MIDR_APPLE_M1_ICESTORM 0x610F0220
|
||||||
|
#define MIDR_APPLE_M1_FIRESTORM 0x610F0230
|
||||||
|
#ifndef CPUFAMILY_ARM_FIRESTORM_ICESTORM
|
||||||
|
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1B588BB3
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/global.h"
|
#include "../common/global.h"
|
||||||
@@ -238,7 +244,7 @@ struct cpuInfo* get_cpu_info_linux(struct cpuInfo* cpu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#elif defined __APPLE__ || __MACH__
|
#elif defined __APPLE__ || __MACH__
|
||||||
void fill_cpu_info_firestorm_icestorm(struct cpuInfo* cpu, uint32_t pcores, uint32_t ecores) {
|
void fill_cpu_info_firestorm_icestorm(struct cpuInfo* cpu) {
|
||||||
// 1. Fill ICESTORM
|
// 1. Fill ICESTORM
|
||||||
struct cpuInfo* ice = cpu;
|
struct cpuInfo* ice = cpu;
|
||||||
|
|
||||||
@@ -248,7 +254,7 @@ void fill_cpu_info_firestorm_icestorm(struct cpuInfo* cpu, uint32_t pcores, uint
|
|||||||
ice->feat = get_features_info();
|
ice->feat = get_features_info();
|
||||||
ice->topo = malloc(sizeof(struct topology));
|
ice->topo = malloc(sizeof(struct topology));
|
||||||
ice->topo->cach = ice->cach;
|
ice->topo->cach = ice->cach;
|
||||||
ice->topo->total_cores = ecores;
|
ice->topo->total_cores = 4;
|
||||||
ice->freq = malloc(sizeof(struct frequency));
|
ice->freq = malloc(sizeof(struct frequency));
|
||||||
ice->freq->base = UNKNOWN_DATA;
|
ice->freq->base = UNKNOWN_DATA;
|
||||||
ice->freq->max = 2064;
|
ice->freq->max = 2064;
|
||||||
@@ -264,7 +270,7 @@ void fill_cpu_info_firestorm_icestorm(struct cpuInfo* cpu, uint32_t pcores, uint
|
|||||||
fire->feat = get_features_info();
|
fire->feat = get_features_info();
|
||||||
fire->topo = malloc(sizeof(struct topology));
|
fire->topo = malloc(sizeof(struct topology));
|
||||||
fire->topo->cach = fire->cach;
|
fire->topo->cach = fire->cach;
|
||||||
fire->topo->total_cores = pcores;
|
fire->topo->total_cores = 4;
|
||||||
fire->freq = malloc(sizeof(struct frequency));
|
fire->freq = malloc(sizeof(struct frequency));
|
||||||
fire->freq->base = UNKNOWN_DATA;
|
fire->freq->base = UNKNOWN_DATA;
|
||||||
fire->freq->max = 3200;
|
fire->freq->max = 3200;
|
||||||
@@ -280,26 +286,8 @@ struct cpuInfo* get_cpu_info_mach(struct cpuInfo* cpu) {
|
|||||||
// is a ARM_FIRESTORM_ICESTORM (Apple M1)
|
// is a ARM_FIRESTORM_ICESTORM (Apple M1)
|
||||||
if(cpu_family == CPUFAMILY_ARM_FIRESTORM_ICESTORM) {
|
if(cpu_family == CPUFAMILY_ARM_FIRESTORM_ICESTORM) {
|
||||||
cpu->num_cpus = 2;
|
cpu->num_cpus = 2;
|
||||||
// Now detect the M1 version
|
|
||||||
uint32_t cpu_subfamily = get_sys_info_by_name("hw.cpusubfamily");
|
|
||||||
if(cpu_subfamily == CPUSUBFAMILY_ARM_HG) {
|
|
||||||
// Apple M1
|
|
||||||
fill_cpu_info_firestorm_icestorm(cpu, 4, 4);
|
|
||||||
}
|
|
||||||
else if(cpu_subfamily == CPUSUBFAMILY_ARM_HS || cpu_subfamily == CPUSUBFAMILY_ARM_HC_HD) {
|
|
||||||
// Apple M1 Pro/Max. Detect number of cores
|
|
||||||
uint32_t physicalcpu = get_sys_info_by_name("hw.physicalcpu");
|
|
||||||
if(physicalcpu < 8 || physicalcpu > 10) {
|
|
||||||
printBug("Found invalid physicalcpu: 0x%.8X", physicalcpu);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
fill_cpu_info_firestorm_icestorm(cpu, physicalcpu-2, 2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
printBug("Found invalid cpu_subfamily: 0x%.8X", cpu_subfamily);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
cpu->soc = get_soc();
|
cpu->soc = get_soc();
|
||||||
|
fill_cpu_info_firestorm_icestorm(cpu);
|
||||||
cpu->peak_performance = get_peak_performance(cpu);
|
cpu->peak_performance = get_peak_performance(cpu);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
#include "udev.h"
|
#include "udev.h"
|
||||||
#include "../common/global.h"
|
#include "../common/global.h"
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__MACH__)
|
|
||||||
#include "sysctl.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define min(a,b) (((a)<(b))?(a):(b))
|
#define min(a,b) (((a)<(b))?(a):(b))
|
||||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||||
|
|
||||||
@@ -22,7 +18,8 @@ static char* soc_trademark_string[] = {
|
|||||||
[SOC_VENDOR_KIRIN] = "Kirin ",
|
[SOC_VENDOR_KIRIN] = "Kirin ",
|
||||||
[SOC_VENDOR_BROADCOM] = "Broadcom BCM",
|
[SOC_VENDOR_BROADCOM] = "Broadcom BCM",
|
||||||
[SOC_VENDOR_APPLE] = "Apple ",
|
[SOC_VENDOR_APPLE] = "Apple ",
|
||||||
[SOC_VENDOR_ALLWINNER] = "Allwinner "
|
[SOC_VENDOR_ALLWINNER] = "Allwinner ",
|
||||||
|
[SOC_VENDOR_GOOGLE] = "Google "
|
||||||
};
|
};
|
||||||
|
|
||||||
static char* soc_rpi_string[] = {
|
static char* soc_rpi_string[] = {
|
||||||
@@ -517,6 +514,12 @@ bool match_special(char* soc_name, struct system_on_chip* soc) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Google Pixel 6 (Proably stands for Google Silicon 101)'
|
||||||
|
if((tmp = strstr(soc_name, "gs101")) != NULL) {
|
||||||
|
fill_soc(soc, "Tensor", SOC_GOOGLE_TENSOR, 5);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,22 +649,6 @@ struct system_on_chip* guess_soc_raspbery_pi(struct system_on_chip* soc) {
|
|||||||
return soc;
|
return soc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__MACH__)
|
|
||||||
struct system_on_chip* guess_soc_apple(struct system_on_chip* soc) {
|
|
||||||
uint32_t cpu_subfamily = get_sys_info_by_name("hw.cpusubfamily");
|
|
||||||
if(cpu_subfamily == CPUSUBFAMILY_ARM_HG) {
|
|
||||||
fill_soc(soc, "M1", SOC_APPLE_M1, 5);
|
|
||||||
}
|
|
||||||
else if(cpu_subfamily == CPUSUBFAMILY_ARM_HS) {
|
|
||||||
fill_soc(soc, "M1 Pro", SOC_APPLE_M1_PRO, 5);
|
|
||||||
}
|
|
||||||
else if(cpu_subfamily == CPUSUBFAMILY_ARM_HC_HD) {
|
|
||||||
fill_soc(soc, "M1 Max", SOC_APPLE_M1_MAX, 5);
|
|
||||||
}
|
|
||||||
return soc;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct system_on_chip* get_soc() {
|
struct system_on_chip* get_soc() {
|
||||||
struct system_on_chip* soc = emalloc(sizeof(struct system_on_chip));
|
struct system_on_chip* soc = emalloc(sizeof(struct system_on_chip));
|
||||||
soc->raw_name = NULL;
|
soc->raw_name = NULL;
|
||||||
@@ -695,13 +682,7 @@ struct system_on_chip* get_soc() {
|
|||||||
#endif // ifdef __ANDROID__
|
#endif // ifdef __ANDROID__
|
||||||
}
|
}
|
||||||
#elif defined __APPLE__ || __MACH__
|
#elif defined __APPLE__ || __MACH__
|
||||||
soc = guess_soc_apple(soc);
|
fill_soc(soc, "M1", SOC_APPLE_M1, 5);
|
||||||
if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) {
|
|
||||||
printWarn("SoC detection failed using cpu_subfamily");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return soc;
|
|
||||||
}
|
|
||||||
#endif // ifdef __linux__
|
#endif // ifdef __linux__
|
||||||
|
|
||||||
if(soc->raw_name == NULL) {
|
if(soc->raw_name == NULL) {
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ enum {
|
|||||||
SOC_VENDOR_KIRIN,
|
SOC_VENDOR_KIRIN,
|
||||||
SOC_VENDOR_BROADCOM,
|
SOC_VENDOR_BROADCOM,
|
||||||
SOC_VENDOR_APPLE,
|
SOC_VENDOR_APPLE,
|
||||||
SOC_VENDOR_ALLWINNER
|
SOC_VENDOR_ALLWINNER,
|
||||||
|
SOC_VENDOR_GOOGLE
|
||||||
};
|
};
|
||||||
|
|
||||||
struct system_on_chip {
|
struct system_on_chip {
|
||||||
|
|||||||
@@ -254,8 +254,6 @@ enum {
|
|||||||
SOC_SNAPD_SM8350,
|
SOC_SNAPD_SM8350,
|
||||||
// APPLE
|
// APPLE
|
||||||
SOC_APPLE_M1,
|
SOC_APPLE_M1,
|
||||||
SOC_APPLE_M1_PRO,
|
|
||||||
SOC_APPLE_M1_MAX,
|
|
||||||
// ALLWINNER
|
// ALLWINNER
|
||||||
SOC_ALLWINNER_A10,
|
SOC_ALLWINNER_A10,
|
||||||
SOC_ALLWINNER_A13,
|
SOC_ALLWINNER_A13,
|
||||||
@@ -279,7 +277,9 @@ enum {
|
|||||||
SOC_ALLWINNER_R16,
|
SOC_ALLWINNER_R16,
|
||||||
SOC_ALLWINNER_R40,
|
SOC_ALLWINNER_R40,
|
||||||
SOC_ALLWINNER_R58,
|
SOC_ALLWINNER_R58,
|
||||||
SOC_ALLWINNER_R328
|
SOC_ALLWINNER_R328,
|
||||||
|
// GOOGLE
|
||||||
|
SOC_GOOGLE_TENSOR
|
||||||
};
|
};
|
||||||
|
|
||||||
inline static VENDOR get_soc_vendor_from_soc(SOC soc) {
|
inline static VENDOR get_soc_vendor_from_soc(SOC soc) {
|
||||||
@@ -288,8 +288,9 @@ inline static VENDOR get_soc_vendor_from_soc(SOC soc) {
|
|||||||
else if(soc >= SOC_EXYNOS_3475 && soc <= SOC_EXYNOS_880) return SOC_VENDOR_EXYNOS;
|
else if(soc >= SOC_EXYNOS_3475 && soc <= SOC_EXYNOS_880) return SOC_VENDOR_EXYNOS;
|
||||||
else if(soc >= SOC_MTK_MT6893 && soc <= SOC_MTK_MT8783) return SOC_VENDOR_MEDIATEK;
|
else if(soc >= SOC_MTK_MT6893 && soc <= SOC_MTK_MT8783) return SOC_VENDOR_MEDIATEK;
|
||||||
else if(soc >= SOC_SNAPD_QSD8650 && soc <= SOC_SNAPD_SM8350) return SOC_VENDOR_SNAPDRAGON;
|
else if(soc >= SOC_SNAPD_QSD8650 && soc <= SOC_SNAPD_SM8350) return SOC_VENDOR_SNAPDRAGON;
|
||||||
else if(soc >= SOC_APPLE_M1 && soc <= SOC_APPLE_M1_MAX) return SOC_VENDOR_APPLE;
|
else if(soc >= SOC_APPLE_M1 && soc <= SOC_APPLE_M1) return SOC_VENDOR_APPLE;
|
||||||
else if(soc >= SOC_ALLWINNER_A10 && soc <= SOC_ALLWINNER_R328) return SOC_VENDOR_ALLWINNER;
|
else if(soc >= SOC_ALLWINNER_A10 && soc <= SOC_ALLWINNER_R328) return SOC_VENDOR_ALLWINNER;
|
||||||
|
else if(soc == SOC_GOOGLE_TENSOR) return SOC_VENDOR_GOOGLE;
|
||||||
return SOC_VENDOR_UNKNOWN;
|
return SOC_VENDOR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,6 @@
|
|||||||
#ifndef __SYSCTL__
|
#ifndef __SYSCTL__
|
||||||
#define __SYSCTL__
|
#define __SYSCTL__
|
||||||
|
|
||||||
// From Linux kernel: arch/arm64/include/asm/cputype.h
|
|
||||||
#define MIDR_APPLE_M1_ICESTORM 0x610F0220
|
|
||||||
#define MIDR_APPLE_M1_FIRESTORM 0x610F0230
|
|
||||||
#ifndef CPUFAMILY_ARM_FIRESTORM_ICESTORM
|
|
||||||
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1B588BB3
|
|
||||||
#endif
|
|
||||||
#ifndef CPUSUBFAMILY_ARM_HG
|
|
||||||
#define CPUSUBFAMILY_ARM_HG 2
|
|
||||||
#endif
|
|
||||||
#ifndef CPUSUBFAMILY_ARM_HS
|
|
||||||
#define CPUSUBFAMILY_ARM_HS 4
|
|
||||||
#endif
|
|
||||||
#ifndef CPUSUBFAMILY_ARM_HC_HD
|
|
||||||
#define CPUSUBFAMILY_ARM_HC_HD 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint32_t get_sys_info_by_name(char* name);
|
uint32_t get_sys_info_by_name(char* name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -103,9 +103,7 @@ enum {
|
|||||||
UARCH_BRAHMA_B15,
|
UARCH_BRAHMA_B15,
|
||||||
UARCH_BRAHMA_B53,
|
UARCH_BRAHMA_B53,
|
||||||
UARCH_XGENE, // Applied Micro X-Gene.
|
UARCH_XGENE, // Applied Micro X-Gene.
|
||||||
UARCH_TAISHAN_V110, // HiSilicon TaiShan v110 (Huawei Kunpeng 920 series processors).
|
UARCH_TAISHAN_V110 // HiSilicon TaiShan v110 (Huawei Kunpeng 920 series processors).
|
||||||
// PHYTIUM
|
|
||||||
UARCH_XIAOMI, // Not to be confused with Xiaomi Inc
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const ISA isas_uarch[] = {
|
static const ISA isas_uarch[] = {
|
||||||
@@ -158,7 +156,6 @@ static const ISA isas_uarch[] = {
|
|||||||
[UARCH_ICESTORM] = ISA_ARMv8_4_A,
|
[UARCH_ICESTORM] = ISA_ARMv8_4_A,
|
||||||
[UARCH_FIRESTORM] = ISA_ARMv8_4_A,
|
[UARCH_FIRESTORM] = ISA_ARMv8_4_A,
|
||||||
[UARCH_PJ4] = ISA_ARMv7_A,
|
[UARCH_PJ4] = ISA_ARMv7_A,
|
||||||
[UARCH_XIAOMI] = ISA_ARMv8_A,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static char* isas_string[] = {
|
static char* isas_string[] = {
|
||||||
@@ -292,9 +289,6 @@ struct uarch* get_uarch_from_midr(uint32_t midr, struct cpuInfo* cpu) {
|
|||||||
CHECK_UARCH(arch, cpu, 'S', 0x003, 1, NA, "Exynos M4", UARCH_EXYNOS_M4, CPU_VENDOR_SAMSUNG) // Exynos 9820
|
CHECK_UARCH(arch, cpu, 'S', 0x003, 1, NA, "Exynos M4", UARCH_EXYNOS_M4, CPU_VENDOR_SAMSUNG) // Exynos 9820
|
||||||
CHECK_UARCH(arch, cpu, 'S', 0x004, 1, NA, "Exynos M5", UARCH_EXYNOS_M5, CPU_VENDOR_SAMSUNG) // Exynos 9820 (this one looks wrong at uarch.c ...)
|
CHECK_UARCH(arch, cpu, 'S', 0x004, 1, NA, "Exynos M5", UARCH_EXYNOS_M5, CPU_VENDOR_SAMSUNG) // Exynos 9820 (this one looks wrong at uarch.c ...)
|
||||||
|
|
||||||
CHECK_UARCH(arch, cpu, 'p', 0x663, 1, NA, "Xiaomi", UARCH_XIAOMI, CPU_VENDOR_PHYTIUM) // From a fellow contributor (https://github.com/Dr-Noob/cpufetch/issues/125)
|
|
||||||
// Also interesting: https://en.wikipedia.org/wiki/FeiTeng_(processor)
|
|
||||||
|
|
||||||
CHECK_UARCH(arch, cpu, 'a', 0x022, NA, NA, "Icestorm", UARCH_ICESTORM, CPU_VENDOR_APPLE)
|
CHECK_UARCH(arch, cpu, 'a', 0x022, NA, NA, "Icestorm", UARCH_ICESTORM, CPU_VENDOR_APPLE)
|
||||||
CHECK_UARCH(arch, cpu, 'a', 0x023, NA, NA, "Firestorm", UARCH_FIRESTORM, CPU_VENDOR_APPLE)
|
CHECK_UARCH(arch, cpu, 'a', 0x023, NA, NA, "Firestorm", UARCH_FIRESTORM, CPU_VENDOR_APPLE)
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ struct ascii_logo {
|
|||||||
uint32_t width;
|
uint32_t width;
|
||||||
uint32_t height;
|
uint32_t height;
|
||||||
bool replace_blocks;
|
bool replace_blocks;
|
||||||
char color_ascii[3][100];
|
char color_ascii[4][100];
|
||||||
char color_text[2][100];
|
char color_text[2][100];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -236,6 +236,22 @@ $C1 ##### ##. \
|
|||||||
$C1 ###########. \
|
$C1 ###########. \
|
||||||
$C1 "
|
$C1 "
|
||||||
|
|
||||||
|
#define ASCII_GOOGLE \
|
||||||
|
"$C1 \
|
||||||
|
$C1 ############ \
|
||||||
|
$C1 ################### \
|
||||||
|
$C1 ##################### \
|
||||||
|
$C1 ######## \
|
||||||
|
$C2 ###$C1#### \
|
||||||
|
$C2 #######$C3 ############## \
|
||||||
|
$C2 #######$C3 ############## \
|
||||||
|
$C2 #######$C3 ############## \
|
||||||
|
$C2 ###$C4####$C3 ####### \
|
||||||
|
$C4 ######## $C3######## \
|
||||||
|
$C4 #################$C3####### \
|
||||||
|
$C4 ###############$C3#### \
|
||||||
|
$C4 ########### "
|
||||||
|
|
||||||
// --------------------- LONG LOGOS ------------------------- //
|
// --------------------- LONG LOGOS ------------------------- //
|
||||||
#define ASCII_AMD_L \
|
#define ASCII_AMD_L \
|
||||||
"$C1 \
|
"$C1 \
|
||||||
@@ -322,9 +338,9 @@ $C1 ############ ################ ######### ## ######### "
|
|||||||
|
|
||||||
typedef struct ascii_logo asciiL;
|
typedef struct ascii_logo asciiL;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------+
|
// ------------------------------------------------------------------------------------------------------------------+
|
||||||
// | LOGO | W | H | REPLACE | COLORS LOGO (>0 && <10) | COLORS TEXT (=2) |
|
// | LOGO | W | H | REPLACE | COLORS LOGO (>0 && <10) | COLORS TEXT (=2) |
|
||||||
// ------------------------------------------------------------------------------------------------------+
|
// ------------------------------------------------------------------------------------------------------------------+
|
||||||
asciiL logo_amd = { ASCII_AMD, 39, 15, false, {C_FG_WHITE, C_FG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };
|
asciiL logo_amd = { ASCII_AMD, 39, 15, false, {C_FG_WHITE, C_FG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };
|
||||||
asciiL logo_intel = { ASCII_INTEL, 48, 14, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} };
|
asciiL logo_intel = { ASCII_INTEL, 48, 14, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} };
|
||||||
asciiL logo_intel_new = { ASCII_INTEL_NEW, 51, 9, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} };
|
asciiL logo_intel_new = { ASCII_INTEL_NEW, 51, 9, false, {C_FG_CYAN}, {C_FG_CYAN, C_FG_WHITE} };
|
||||||
@@ -337,8 +353,9 @@ asciiL logo_arm = { ASCII_ARM, 42, 5, false, {C_FG_CYAN},
|
|||||||
asciiL logo_ibm = { ASCII_IBM, 42, 9, false, {C_FG_CYAN, C_FG_WHITE}, {C_FG_CYAN, C_FG_WHITE} };
|
asciiL logo_ibm = { ASCII_IBM, 42, 9, false, {C_FG_CYAN, C_FG_WHITE}, {C_FG_CYAN, C_FG_WHITE} };
|
||||||
asciiL logo_apple = { ASCII_APPLE, 32, 17, false, {C_FG_WHITE}, {C_FG_CYAN, C_FG_B_WHITE} };
|
asciiL logo_apple = { ASCII_APPLE, 32, 17, false, {C_FG_WHITE}, {C_FG_CYAN, C_FG_B_WHITE} };
|
||||||
asciiL logo_allwinner = { ASCII_ALLWINNER, 47, 16, false, {C_FG_CYAN}, {C_FG_B_BLACK, C_FG_B_CYAN } };
|
asciiL logo_allwinner = { ASCII_ALLWINNER, 47, 16, false, {C_FG_CYAN}, {C_FG_B_BLACK, C_FG_B_CYAN } };
|
||||||
|
asciiL logo_google = { ASCII_GOOGLE, 34, 14, false, {C_FG_RED, C_FG_YELLOW, C_FG_BLUE, C_FG_GREEN}, {C_FG_BLUE} };
|
||||||
|
|
||||||
// Long variants | ----------------------------------------------------------------------------------------------------|
|
// Long variants | ---------------------------------------------------------------------------------------------------------------|
|
||||||
asciiL logo_amd_l = { ASCII_AMD_L, 62, 19, true, {C_BG_WHITE, C_BG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };
|
asciiL logo_amd_l = { ASCII_AMD_L, 62, 19, true, {C_BG_WHITE, C_BG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };
|
||||||
asciiL logo_intel_l = { ASCII_INTEL_L, 62, 19, true, {C_BG_CYAN, C_BG_WHITE}, {C_FG_CYAN, C_FG_WHITE} };
|
asciiL logo_intel_l = { ASCII_INTEL_L, 62, 19, true, {C_BG_CYAN, C_BG_WHITE}, {C_FG_CYAN, C_FG_WHITE} };
|
||||||
asciiL logo_intel_l_new = { ASCII_INTEL_L_NEW, 57, 14, true, {C_BG_CYAN, C_BG_WHITE, C_BG_BLUE}, {C_FG_CYAN, C_FG_WHITE} };
|
asciiL logo_intel_l_new = { ASCII_INTEL_L_NEW, 57, 14, true, {C_BG_CYAN, C_BG_WHITE, C_BG_BLUE}, {C_FG_CYAN, C_FG_WHITE} };
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ enum {
|
|||||||
CPU_VENDOR_HUAWUEI,
|
CPU_VENDOR_HUAWUEI,
|
||||||
CPU_VENDOR_SAMSUNG,
|
CPU_VENDOR_SAMSUNG,
|
||||||
CPU_VENDOR_MARVELL,
|
CPU_VENDOR_MARVELL,
|
||||||
CPU_VENDOR_PHYTIUM,
|
|
||||||
// OTHERS
|
// OTHERS
|
||||||
CPU_VENDOR_UNKNOWN,
|
CPU_VENDOR_UNKNOWN,
|
||||||
CPU_VENDOR_INVALID
|
CPU_VENDOR_INVALID
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void printBug(const char *fmt, ...) {
|
|||||||
#if defined(ARCH_X86) || defined(ARCH_PPC)
|
#if defined(ARCH_X86) || defined(ARCH_PPC)
|
||||||
fprintf(stderr, "Please, create a new issue with this error message, the output of 'cpufetch' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues\n");
|
fprintf(stderr, "Please, create a new issue with this error message, the output of 'cpufetch' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues\n");
|
||||||
#elif ARCH_ARM
|
#elif ARCH_ARM
|
||||||
fprintf(stderr, "Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues\n");
|
fprintf(stderr, "Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,15 +111,3 @@ void* ecalloc(size_t nmemb, size_t size) {
|
|||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* erealloc(void *ptr, size_t size) {
|
|
||||||
void* newptr = realloc(ptr, size);
|
|
||||||
|
|
||||||
if(newptr == NULL) {
|
|
||||||
printErr("realloc failed: %s", strerror(errno));
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ int max(int a, int b);
|
|||||||
char *strremove(char *str, const char *sub);
|
char *strremove(char *str, const char *sub);
|
||||||
void* emalloc(size_t size);
|
void* emalloc(size_t size);
|
||||||
void* ecalloc(size_t nmemb, size_t size);
|
void* ecalloc(size_t nmemb, size_t size);
|
||||||
void* erealloc(void *ptr, size_t size);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
static const char* OS_STR = "Unknown OS";
|
static const char* OS_STR = "Unknown OS";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char* VERSION = "1.02";
|
static const char* VERSION = "1.01";
|
||||||
|
|
||||||
void print_help(char *argv[]) {
|
void print_help(char *argv[]) {
|
||||||
const char **t = args_str;
|
const char **t = args_str;
|
||||||
|
|||||||
@@ -355,6 +355,8 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter
|
|||||||
art->art = &logo_apple;
|
art->art = &logo_apple;
|
||||||
else if(art->vendor == SOC_VENDOR_ALLWINNER)
|
else if(art->vendor == SOC_VENDOR_ALLWINNER)
|
||||||
art->art = &logo_allwinner;
|
art->art = &logo_allwinner;
|
||||||
|
else if(art->vendor == SOC_VENDOR_GOOGLE)
|
||||||
|
art->art = &logo_google;
|
||||||
else {
|
else {
|
||||||
art->art = choose_ascii_art_aux(&logo_arm_l, &logo_arm, term, lf);
|
art->art = choose_ascii_art_aux(&logo_arm_l, &logo_arm, term, lf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,18 +54,13 @@ char* read_file(char* path, int* len) {
|
|||||||
//File exists, read it
|
//File exists, read it
|
||||||
int bytes_read = 0;
|
int bytes_read = 0;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
int block = 1024;
|
int block = 128;
|
||||||
int buf_size = block * 4;
|
char* buf = emalloc(sizeof(char)*DEFAULT_FILE_SIZE);
|
||||||
char* buf = emalloc(sizeof(char) * buf_size);
|
memset(buf, 0, sizeof(char)*DEFAULT_FILE_SIZE);
|
||||||
|
|
||||||
while ((bytes_read = read(fd, buf+offset, block)) > 0) {
|
while ( (bytes_read = read(fd, buf+offset, block)) > 0 ) {
|
||||||
offset += bytes_read;
|
offset += bytes_read;
|
||||||
if(offset + block > buf_size) {
|
|
||||||
buf = erealloc(buf, sizeof(char) * (buf_size + block));
|
|
||||||
buf_size += block;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
buf[offset] = '\0';
|
|
||||||
|
|
||||||
if (close(fd) == -1) {
|
if (close(fd) == -1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#define _PATH_FREQUENCY_MAX_LEN 100
|
#define _PATH_FREQUENCY_MAX_LEN 100
|
||||||
#define _PATH_CACHE_MAX_LEN 200
|
#define _PATH_CACHE_MAX_LEN 200
|
||||||
|
#define DEFAULT_FILE_SIZE 4096
|
||||||
|
|
||||||
char* read_file(char* path, int* len);
|
char* read_file(char* path, int* len);
|
||||||
long get_max_freq_from_file(uint32_t core);
|
long get_max_freq_from_file(uint32_t core);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "../../common/cpu.h"
|
#include "../../common/cpu.h"
|
||||||
|
|
||||||
#define MEASURE_TIME_SECONDS 5
|
#define MEASURE_TIME_SECONDS 5
|
||||||
#define LOOP_ITERS 100000000
|
#define LOOP_ITERS 1000000000
|
||||||
|
|
||||||
int64_t measure_frequency(struct cpuInfo* cpu);
|
int64_t measure_frequency(struct cpuInfo* cpu);
|
||||||
|
|
||||||
|
|||||||
@@ -15,25 +15,13 @@ void* compute_avx() {
|
|||||||
|
|
||||||
struct timeval begin, now;
|
struct timeval begin, now;
|
||||||
|
|
||||||
__m256 a[8];
|
__m256 a = _mm256_set1_ps(1.5);
|
||||||
__m256 b[8];
|
__m256 b = _mm256_set1_ps(1.2);
|
||||||
|
|
||||||
for(int i=0; i < 8; i++) {
|
|
||||||
a[i] = _mm256_set1_ps(1.5);
|
|
||||||
b[i] = _mm256_set1_ps(1.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
gettimeofday(&begin, NULL);
|
gettimeofday(&begin, NULL);
|
||||||
while(!end) {
|
while(!end) {
|
||||||
for(uint64_t i=0; i < LOOP_ITERS; i++) {
|
for(uint64_t i=0; i < LOOP_ITERS; i++) {
|
||||||
a[0] = _mm256_add_ps(a[0], b[0]);
|
a = _mm256_add_ps(a, b);
|
||||||
a[1] = _mm256_add_ps(a[1], b[1]);
|
|
||||||
a[2] = _mm256_add_ps(a[2], b[2]);
|
|
||||||
a[3] = _mm256_add_ps(a[3], b[3]);
|
|
||||||
a[4] = _mm256_add_ps(a[4], b[4]);
|
|
||||||
a[5] = _mm256_add_ps(a[5], b[5]);
|
|
||||||
a[6] = _mm256_add_ps(a[6], b[6]);
|
|
||||||
a[7] = _mm256_add_ps(a[7], b[7]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
gettimeofday(&now, NULL);
|
||||||
@@ -46,8 +34,7 @@ void* compute_avx() {
|
|||||||
printf("fopen: %s", strerror(errno));
|
printf("fopen: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(int i=0; i < 8; i++)
|
fprintf(fp, "%f", a[0]);
|
||||||
fprintf(fp, "%f", a[i][0]);
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "freq.h"
|
#include "freq.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For AVX512, it seems that multiple independent
|
||||||
|
* instructions are needed to force the CPU to
|
||||||
|
* use AVX512 frequency, since with only one instruction
|
||||||
|
* (as the AVX implementaion) it still uses AVX frequency
|
||||||
|
*/
|
||||||
void* compute_avx512() {
|
void* compute_avx512() {
|
||||||
bool end = false;
|
bool end = false;
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ enum {
|
|||||||
UARCH_ITANIUM2,
|
UARCH_ITANIUM2,
|
||||||
UARCH_ICE_LAKE,
|
UARCH_ICE_LAKE,
|
||||||
UARCH_TIGER_LAKE,
|
UARCH_TIGER_LAKE,
|
||||||
UARCH_ALDER_LAKE,
|
|
||||||
// AMD //
|
// AMD //
|
||||||
UARCH_AM486,
|
UARCH_AM486,
|
||||||
UARCH_AM5X86,
|
UARCH_AM5X86,
|
||||||
@@ -229,7 +228,6 @@ struct uarch* get_uarch_from_cpuid_intel(uint32_t ef, uint32_t f, uint32_t em, u
|
|||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 11, "Whiskey Lake", UARCH_WHISKEY_LAKE, 14) // wikichip
|
CHECK_UARCH(arch, 0, 6, 8, 14, 11, "Whiskey Lake", UARCH_WHISKEY_LAKE, 14) // wikichip
|
||||||
CHECK_UARCH(arch, 0, 6, 8, 14, 12, "Comet Lake", UARCH_COMET_LAKE, 14) // wikichip
|
CHECK_UARCH(arch, 0, 6, 8, 14, 12, "Comet Lake", UARCH_COMET_LAKE, 14) // wikichip
|
||||||
CHECK_UARCH(arch, 0, 6, 9, 6, NA, "Tremont", UARCH_TREMONT, 10) // LX*
|
CHECK_UARCH(arch, 0, 6, 9, 6, NA, "Tremont", UARCH_TREMONT, 10) // LX*
|
||||||
CHECK_UARCH(arch, 0, 6, 9, 7, NA, "Alder Lake", UARCH_ALDER_LAKE, 10) // wikichip
|
|
||||||
CHECK_UARCH(arch, 0, 6, 9, 10, NA, "Tremont", UARCH_TREMONT, 10) // instlatx64
|
CHECK_UARCH(arch, 0, 6, 9, 10, NA, "Tremont", UARCH_TREMONT, 10) // instlatx64
|
||||||
CHECK_UARCH(arch, 0, 6, 9, 12, NA, "Tremont", UARCH_TREMONT, 10) // LX*
|
CHECK_UARCH(arch, 0, 6, 9, 12, NA, "Tremont", UARCH_TREMONT, 10) // LX*
|
||||||
CHECK_UARCH(arch, 0, 6, 9, 13, NA, "Sunny Cove", UARCH_SUNNY_COVE, 10) // LX*
|
CHECK_UARCH(arch, 0, 6, 9, 13, NA, "Sunny Cove", UARCH_SUNNY_COVE, 10) // LX*
|
||||||
@@ -428,7 +426,6 @@ int get_number_of_vpus(struct cpuInfo* cpu) {
|
|||||||
|
|
||||||
bool choose_new_intel_logo_uarch(struct cpuInfo* cpu) {
|
bool choose_new_intel_logo_uarch(struct cpuInfo* cpu) {
|
||||||
switch(cpu->arch->uarch) {
|
switch(cpu->arch->uarch) {
|
||||||
case UARCH_ALDER_LAKE:
|
|
||||||
case UARCH_ROCKET_LAKE:
|
case UARCH_ROCKET_LAKE:
|
||||||
case UARCH_TIGER_LAKE:
|
case UARCH_TIGER_LAKE:
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user