Re: MIPS-specific porting issue
Florian Lohoff <[email protected]>
| Newsgroups | gmane.linux.debian.ports.mips |
|---|---|
| Organization | rfc822 - pure communication |
| Message-ID | <[email protected]> |
On Sat, Dec 04, 2021 at 12:07:29AM +0000, YANG Jiaxun wrote:
> Hi Stéphane.
>
> MIPS do have a way to access count register from user space.
> Unfortunately there is no GCC intrinsic function for it, you may try following inline assembly.
>
> static inline unsigned long get_count() {
> unsigned long count;
> asm volatile ("rdhwr %[rt], $2" : [rt] "=d" (count));
> return count;
> }
>
> return Val_long (get_count());
To be more precise - Not all CPUs have this (Older MIPS I for example
dont) but there is kernel emulation / instruction trapping for it.
And - I dont think Debian supports MIPS I targets anymore.
Flo
--
Florian Lohoff [email protected]
Any sufficiently advanced technology is indistinguishable from magic.
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdb9o7oebX2papQ/KkN1BIMsJ8i8FAmGt0YYACgkQkN1BIMsJ 8i+whQ/+Nr+kevVwJuLm1DbDldnXi/foqY+SPNqUdBmc/2flKcowQT9KNQj2RQu+ fMPTWqSA408y8CN9dcIc1MYZaIDgYO68YmgwC7iqhlJBiYitmRtprHzA8gJb1Alg PS8wkFZFblT1HWI/VLiDWVe6nfi+pjoqxOcvt8q5iwCROe1YPxaxQCoDmqxhpbtM IelzNuXlWgNHa/y5UOIscfa4K7hQZ4ezMTrjn30xNpoJmTkoxC0hbWQeannfHuna duOwyCePm+1uToXeTIV3wYvj9dtJRlJ8tOcvIAn35uwVnY3tUvR28Jk7FloDhJUp 8fampS6xnEBAyci9HcdnO1V+dP7nviNgV1/hX9edCK38VhHYQ3KZ/iQ+5eR4FgLn XPBTrThRhtr1mMgDwsj6vesnW775/PQwarSB1gF0gHgYsgMiOCkOm4YKXDqLhm0L Jqcox8nKQm3RCkHTUPxVybgknhEBEynl98MKqALj5elKgGnl+pWChWerbF6admbG DuIu3AbYIP+xoBnxLDOeM3aeuK15kG8HDl2qKNVzTPvK392094L9Ga4pPEEN2olw +M1qSDyeVtn6dUAJfwj/U9QfHdy02TMtMlR5ThUwx98y6lwZauGSO7QE7F5/07hE dLIqks8JbHOI72h5x2zwHowJz6ujxqVVNa8CCnz0MsvGVsFZGm4= =ZHI+ -----END PGP SIGNATURE-----