Print this page
10597 would like a way to set NMI behavior at boot
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/fakebop.c
          +++ new/usr/src/uts/i86pc/os/fakebop.c
↓ open down ↓ 2907 lines elided ↑ open up ↑
2908 2908  
2909 2909  /*ARGSUSED*/
2910 2910  int
2911 2911  boot_compinfo(int fd, struct compinfo *cbp)
2912 2912  {
2913 2913          cbp->iscmp = 0;
2914 2914          cbp->blksize = MAXBSIZE;
2915 2915          return (0);
2916 2916  }
2917 2917  
2918      -#define BP_MAX_STRLEN   32
2919      -
2920 2918  /*
2921      - * Get value for given boot property
     2919 + * Get an integer value for given boot property
2922 2920   */
2923 2921  int
2924 2922  bootprop_getval(const char *prop_name, u_longlong_t *prop_value)
2925 2923  {
2926 2924          int             boot_prop_len;
2927 2925          char            str[BP_MAX_STRLEN];
2928 2926          u_longlong_t    value;
2929 2927  
2930 2928          boot_prop_len = BOP_GETPROPLEN(bootops, prop_name);
2931      -        if (boot_prop_len < 0 || boot_prop_len > sizeof (str) ||
     2929 +        if (boot_prop_len < 0 || boot_prop_len >= sizeof (str) ||
2932 2930              BOP_GETPROP(bootops, prop_name, str) < 0 ||
2933 2931              kobj_getvalue(str, &value) == -1)
2934 2932                  return (-1);
2935 2933  
2936 2934          if (prop_value)
2937 2935                  *prop_value = value;
2938 2936  
2939 2937          return (0);
     2938 +}
     2939 +
     2940 +int
     2941 +bootprop_getstr(const char *prop_name, char *buf, size_t buflen)
     2942 +{
     2943 +        int boot_prop_len = BOP_GETPROPLEN(bootops, prop_name);
     2944 +
     2945 +        if (boot_prop_len < 0 || boot_prop_len >= buflen ||
     2946 +            BOP_GETPROP(bootops, prop_name, buf) < 0)
     2947 +                return (-1);
     2948 +
     2949 +        return (0);
2940 2950  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX