Print this page
11630 remove checks for 64-bit capable hardware

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/openprom.c
          +++ new/usr/src/uts/common/io/openprom.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2019 Peter Tribble.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Ported from 4.1.1_PSRA: "@(#)openprom.c 1.19 91/02/19 SMI";
  28   29   *
  29   30   * Porting notes:
  30   31   *
  31   32   * OPROMU2P unsupported after SunOS 4.x.
  32   33   *
  33   34   * Only one of these devices per system is allowed.
↓ open down ↓ 449 lines elided ↑ open up ↑
 483  484          case OPROMSNAPSHOT:
 484  485          case OPROMGETCONS:
 485  486          case OPROMGETBOOTARGS:
 486  487          case OPROMGETBOOTPATH:
 487  488          case OPROMGETVERSION:
 488  489          case OPROMPATH2DRV:
 489  490          case OPROMPROM2DEVNAME:
 490  491  #if !defined(__i386) && !defined(__amd64)
 491  492          case OPROMGETFBNAME:
 492  493          case OPROMDEV2PROMNAME:
 493      -        case OPROMREADY64:
 494  494  #endif  /* !__i386 && !__amd64 */
 495  495                  if ((mode & FREAD) == 0) {
 496  496                          return (EPERM);
 497  497                  }
 498  498                  break;
 499  499  
 500  500          default:
 501  501                  return (EINVAL);
 502  502          }
 503  503  
↓ open down ↓ 466 lines elided ↑ open up ↑
 970  970                   * 4010173: 'name' is not an option, but it is a property.
 971  971                   */
 972  972                  if (strcmp(opp->oprom_array, "name") == 0)
 973  973                          error = EINVAL;
 974  974                  else if (prom_setprop(node_id, opp->oprom_array,
 975  975                      valbuf, valsize) < 0)
 976  976                          error = EINVAL;
 977  977  
 978  978                  break;
 979  979          }
 980      -
 981      -        case OPROMREADY64: {
 982      -                struct openprom_opr64 *opr =
 983      -                    (struct openprom_opr64 *)opp->oprom_array;
 984      -                int i;
 985      -                pnode_t id;
 986      -
 987      -                if (userbufsize < sizeof (*opr)) {
 988      -                        error = EINVAL;
 989      -                        break;
 990      -                }
 991      -
 992      -                valsize = userbufsize -
 993      -                    offsetof(struct openprom_opr64, message);
 994      -
 995      -                i = prom_version_check(opr->message, valsize, &id);
 996      -                opr->return_code = i;
 997      -                opr->nodeid = (int)id;
 998      -
 999      -                valsize = offsetof(struct openprom_opr64, message);
1000      -                valsize += strlen(opr->message) + 1;
1001      -
1002      -                /*
1003      -                 * copyout only the part of the user buffer we need to.
1004      -                 */
1005      -                if (copyout(opp, (void *)arg,
1006      -                    (size_t)(min((uint_t)valsize, userbufsize) +
1007      -                    sizeof (uint_t))) != 0)
1008      -                        error = EFAULT;
1009      -                break;
1010      -
1011      -        }       /* case OPROMREADY64 */
1012  980  #endif  /* !__i386 && !__amd64 */
1013  981          }       /* switch (cmd) */
1014  982  
1015  983          kmem_free(opp, userbufsize + sizeof (uint_t) + 1);
1016  984          return (error);
1017  985  }
1018  986  
1019  987  /*ARGSUSED*/
1020  988  static int
1021  989  opromioctl(dev_t dev, int cmd, intptr_t arg, int mode,
↓ open down ↓ 332 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX