2
0

target_proc.h 848 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Sparc specific proc functions for linux-user
  3. *
  4. * SPDX-License-Identifier: GPL-2.0-or-later
  5. */
  6. #ifndef SPARC_TARGET_PROC_H
  7. #define SPARC_TARGET_PROC_H
  8. static int open_cpuinfo(CPUArchState *cpu_env, int fd)
  9. {
  10. int i, num_cpus;
  11. const char *cpu_type;
  12. num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
  13. if (cpu_env->def.features & CPU_FEATURE_HYPV) {
  14. cpu_type = "sun4v";
  15. } else {
  16. cpu_type = "sun4u";
  17. }
  18. dprintf(fd, "cpu\t\t: %s (QEMU)\n", cpu_env->def.name);
  19. dprintf(fd, "type\t\t: %s\n", cpu_type);
  20. dprintf(fd, "ncpus probed\t: %d\n", num_cpus);
  21. dprintf(fd, "ncpus active\t: %d\n", num_cpus);
  22. dprintf(fd, "State:\n");
  23. for (i = 0; i < num_cpus; i++) {
  24. dprintf(fd, "CPU%d:\t\t: online\n", i);
  25. }
  26. return 0;
  27. }
  28. #define HAVE_ARCH_PROC_CPUINFO
  29. #endif /* SPARC_TARGET_PROC_H */