843 return (DCMD_USAGE);
844
845 if (mdb_lookup_by_name("x86_feature_names", &sym) == -1) {
846 mdb_warn("couldn't find x86_feature_names");
847 return (DCMD_ERR);
848 }
849
850 fset = mdb_zalloc(sz, UM_NOSLEEP);
851 if (fset == NULL) {
852 mdb_warn("failed to allocate memory for x86_featureset");
853 return (DCMD_ERR);
854 }
855
856 if (mdb_readvar(fset, "x86_featureset") != sz) {
857 mdb_warn("failed to read x86_featureset");
858 mdb_free(fset, sz);
859 return (DCMD_ERR);
860 }
861
862 for (ii = 0; ii < NUM_X86_FEATURES; ii++) {
863 if (!BT_TEST((ulong_t *)fset, ii))
864 continue;
865
866 if (mdb_vread(&nptr, sizeof (char *), sym.st_value +
867 sizeof (void *) * ii) != sizeof (char *)) {
868 mdb_warn("failed to read feature array %d", ii);
869 mdb_free(fset, sz);
870 return (DCMD_ERR);
871 }
872
873 if (mdb_readstr(name, sizeof (name), nptr) == -1) {
874 mdb_warn("failed to read feature %d", ii);
875 mdb_free(fset, sz);
876 return (DCMD_ERR);
877 }
878 mdb_printf("%s\n", name);
879 }
880
881 mdb_free(fset, sz);
882 return (DCMD_OK);
|
843 return (DCMD_USAGE);
844
845 if (mdb_lookup_by_name("x86_feature_names", &sym) == -1) {
846 mdb_warn("couldn't find x86_feature_names");
847 return (DCMD_ERR);
848 }
849
850 fset = mdb_zalloc(sz, UM_NOSLEEP);
851 if (fset == NULL) {
852 mdb_warn("failed to allocate memory for x86_featureset");
853 return (DCMD_ERR);
854 }
855
856 if (mdb_readvar(fset, "x86_featureset") != sz) {
857 mdb_warn("failed to read x86_featureset");
858 mdb_free(fset, sz);
859 return (DCMD_ERR);
860 }
861
862 for (ii = 0; ii < NUM_X86_FEATURES; ii++) {
863 /* LINTED */
864 if (!BT_TEST((ulong_t *)fset, ii))
865 continue;
866
867 if (mdb_vread(&nptr, sizeof (char *), sym.st_value +
868 sizeof (void *) * ii) != sizeof (char *)) {
869 mdb_warn("failed to read feature array %d", ii);
870 mdb_free(fset, sz);
871 return (DCMD_ERR);
872 }
873
874 if (mdb_readstr(name, sizeof (name), nptr) == -1) {
875 mdb_warn("failed to read feature %d", ii);
876 mdb_free(fset, sz);
877 return (DCMD_ERR);
878 }
879 mdb_printf("%s\n", name);
880 }
881
882 mdb_free(fset, sz);
883 return (DCMD_OK);
|