~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/mips/loongson64/boardinfo.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #include <linux/kobject.h>
  3 #include <boot_param.h>
  4 
  5 static ssize_t boardinfo_show(struct kobject *kobj,
  6                               struct kobj_attribute *attr, char *buf)
  7 {
  8         char board_manufacturer[64] = {0};
  9         char *tmp_board_manufacturer = board_manufacturer;
 10         char bios_vendor[64] = {0};
 11         char *tmp_bios_vendor = bios_vendor;
 12 
 13         strcpy(board_manufacturer, eboard->name);
 14         strcpy(bios_vendor, einter->description);
 15 
 16         return sprintf(buf,
 17                        "Board Info\n"
 18                        "Manufacturer\t\t: %s\n"
 19                        "Board Name\t\t: %s\n"
 20                        "Family\t\t\t: LOONGSON3\n\n"
 21                        "BIOS Info\n"
 22                        "Vendor\t\t\t: %s\n"
 23                        "Version\t\t\t: %s\n"
 24                        "ROM Size\t\t: %d KB\n"
 25                        "Release Date\t\t: %s\n",
 26                        strsep(&tmp_board_manufacturer, "-"),
 27                        eboard->name,
 28                        strsep(&tmp_bios_vendor, "-"),
 29                        einter->description,
 30                        einter->size,
 31                        especial->special_name);
 32 }
 33 static struct kobj_attribute boardinfo_attr = __ATTR(boardinfo, 0444,
 34                                                      boardinfo_show, NULL);
 35 
 36 static int __init boardinfo_init(void)
 37 {
 38         struct kobject *lefi_kobj;
 39 
 40         lefi_kobj = kobject_create_and_add("lefi", firmware_kobj);
 41         if (!lefi_kobj) {
 42                 pr_err("lefi: Firmware registration failed.\n");
 43                 return -ENOMEM;
 44         }
 45 
 46         return sysfs_create_file(lefi_kobj, &boardinfo_attr.attr);
 47 }
 48 late_initcall(boardinfo_init);
 49 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php