Lines Matching refs:p

182     char *p, *q;  in write_smbios_tables()  local
190 p = (char *)start; in write_smbios_tables()
194 if ( q != p ) \ in write_smbios_tables()
196 if ( (q - p) > *max_struct_size ) \ in write_smbios_tables()
197 *max_struct_size = q - p; \ in write_smbios_tables()
198 p = q; \ in write_smbios_tables()
201 do_struct(smbios_type_0_init(p, xen_version, xen_major_version, in write_smbios_tables()
203 do_struct(smbios_type_1_init(p, xen_version, uuid)); in write_smbios_tables()
204 do_struct(smbios_type_2_init(p)); in write_smbios_tables()
205 do_struct(smbios_type_3_init(p)); in write_smbios_tables()
207 do_struct(smbios_type_4_init(p, cpu_num, cpu_manufacturer)); in write_smbios_tables()
208 do_struct(smbios_type_11_init(p)); in write_smbios_tables()
212 do_struct(smbios_type_16_init(p, memsize, nr_mem_devs)); in write_smbios_tables()
218 do_struct(smbios_type_17_init(p, dev_memsize, i)); in write_smbios_tables()
219 do_struct(smbios_type_19_init(p, dev_memsize, i)); in write_smbios_tables()
220 do_struct(smbios_type_20_init(p, dev_memsize, i)); in write_smbios_tables()
223 do_struct(smbios_type_22_init(p)); in write_smbios_tables()
224 do_struct(smbios_type_32_init(p)); in write_smbios_tables()
225 do_struct(smbios_type_39_init(p)); in write_smbios_tables()
226 do_struct(smbios_type_vendor_oem_init(p)); in write_smbios_tables()
227 do_struct(smbios_type_127_init(p)); in write_smbios_tables()
231 return ((char *)p - (char *)start); in write_smbios_tables()
263 char *p = NULL; /* points to next point of insertion */ in hvm_write_smbios_tables() local
280 p = xen_version_str; in hvm_write_smbios_tables()
288 strcpy(p, tmp); in hvm_write_smbios_tables()
289 p += tmp_len; in hvm_write_smbios_tables()
294 *p = '.'; in hvm_write_smbios_tables()
295 p++; in hvm_write_smbios_tables()
302 strcpy(p, tmp); in hvm_write_smbios_tables()
303 p += tmp_len; in hvm_write_smbios_tables()
309 strcpy(p, xen_extra_version); in hvm_write_smbios_tables()
310 p += tmp_len; in hvm_write_smbios_tables()
381 struct smbios_type_0 *p = (struct smbios_type_0 *)start; in smbios_type_0_init() local
391 p->header.handle = SMBIOS_HANDLE_TYPE0; in smbios_type_0_init()
395 memset(p, 0, sizeof(*p)); in smbios_type_0_init()
397 p->header.type = 0; in smbios_type_0_init()
398 p->header.length = sizeof(struct smbios_type_0); in smbios_type_0_init()
399 p->header.handle = SMBIOS_HANDLE_TYPE0; in smbios_type_0_init()
401 p->vendor_str = 1; in smbios_type_0_init()
402 p->version_str = 2; in smbios_type_0_init()
403 p->starting_address_segment = 0xe800; in smbios_type_0_init()
404 p->release_date_str = 3; in smbios_type_0_init()
405 p->rom_size = 0; in smbios_type_0_init()
408 p->characteristics[0] = 0x80; /* PCI is supported */ in smbios_type_0_init()
409 p->characteristics[2] = 0x08; /* EDD is supported */ in smbios_type_0_init()
412 p->characteristics_extension_bytes[1] = 0x04; in smbios_type_0_init()
414 p->major_release = (uint8_t) xen_major_version; in smbios_type_0_init()
415 p->minor_release = (uint8_t) xen_minor_version; in smbios_type_0_init()
416 p->embedded_controller_major = 0xff; in smbios_type_0_init()
417 p->embedded_controller_minor = 0xff; in smbios_type_0_init()
441 struct smbios_type_1 *p = (struct smbios_type_1 *)start; in smbios_type_1_init() local
450 p->header.handle = SMBIOS_HANDLE_TYPE1; in smbios_type_1_init()
454 memset(p, 0, sizeof(*p)); in smbios_type_1_init()
456 p->header.type = 1; in smbios_type_1_init()
457 p->header.length = sizeof(struct smbios_type_1); in smbios_type_1_init()
458 p->header.handle = SMBIOS_HANDLE_TYPE1; in smbios_type_1_init()
460 p->manufacturer_str = 1; in smbios_type_1_init()
461 p->product_name_str = 2; in smbios_type_1_init()
462 p->version_str = 3; in smbios_type_1_init()
463 p->serial_number_str = 4; in smbios_type_1_init()
465 memcpy(p->uuid, uuid, 16); in smbios_type_1_init()
467 p->wake_up_type = 0x06; /* power switch */ in smbios_type_1_init()
468 p->sku_str = 0; in smbios_type_1_init()
469 p->family_str = 0; in smbios_type_1_init()
499 struct smbios_type_2 *p = (struct smbios_type_2 *)start; in smbios_type_2_init() local
510 p->header.handle = SMBIOS_HANDLE_TYPE2; in smbios_type_2_init()
513 if ( p->header.length > 13 ) in smbios_type_2_init()
523 memset(p, 0, sizeof(*p)); in smbios_type_2_init()
524 p->header.type = 2; in smbios_type_2_init()
525 p->header.length = sizeof(struct smbios_type_2); in smbios_type_2_init()
526 p->header.handle = SMBIOS_HANDLE_TYPE2; in smbios_type_2_init()
527 p->feature_flags = 0x09; /* Board is a hosting board and replaceable */ in smbios_type_2_init()
528 p->chassis_handle = SMBIOS_HANDLE_TYPE3; in smbios_type_2_init()
529 p->board_type = 0x0a; /* Motherboard */ in smbios_type_2_init()
530 start += sizeof(*p); in smbios_type_2_init()
537 p->manufacturer_str = ++counter; in smbios_type_2_init()
545 p->product_name_str = ++counter; in smbios_type_2_init()
553 p->version_str = ++counter; in smbios_type_2_init()
561 p->serial_number_str = ++counter; in smbios_type_2_init()
569 p->asset_tag_str = ++counter; in smbios_type_2_init()
577 p->location_in_chassis_str = ++counter; in smbios_type_2_init()
587 return start - sizeof(*p); in smbios_type_2_init()
594 struct smbios_type_3 *p = (struct smbios_type_3 *)start; in smbios_type_3_init() local
604 p->header.handle = SMBIOS_HANDLE_TYPE3; in smbios_type_3_init()
608 memset(p, 0, sizeof(*p)); in smbios_type_3_init()
610 p->header.type = 3; in smbios_type_3_init()
611 p->header.length = sizeof(struct smbios_type_3); in smbios_type_3_init()
612 p->header.handle = SMBIOS_HANDLE_TYPE3; in smbios_type_3_init()
614 p->manufacturer_str = ++counter; in smbios_type_3_init()
615 p->type = 0x01; /* other */ in smbios_type_3_init()
616 p->version_str = 0; in smbios_type_3_init()
617 p->serial_number_str = 0; in smbios_type_3_init()
618 p->asset_tag_str = 0; in smbios_type_3_init()
619 p->boot_up_state = 0x03; /* safe */ in smbios_type_3_init()
620 p->power_supply_state = 0x03; /* safe */ in smbios_type_3_init()
621 p->thermal_state = 0x03; /* safe */ in smbios_type_3_init()
622 p->security_status = 0x02; /* unknown */ in smbios_type_3_init()
636 p->serial_number_str = ++counter; in smbios_type_3_init()
643 p->asset_tag_str = ++counter; in smbios_type_3_init()
656 struct smbios_type_4 *p = (struct smbios_type_4 *)start; in smbios_type_4_init() local
659 memset(p, 0, sizeof(*p)); in smbios_type_4_init()
661 p->header.type = 4; in smbios_type_4_init()
662 p->header.length = sizeof(struct smbios_type_4); in smbios_type_4_init()
663 p->header.handle = SMBIOS_HANDLE_TYPE4 + cpu_number; in smbios_type_4_init()
665 p->socket_designation_str = 1; in smbios_type_4_init()
666 p->processor_type = 0x03; /* CPU */ in smbios_type_4_init()
667 p->processor_family = 0x01; /* other */ in smbios_type_4_init()
668 p->manufacturer_str = 2; in smbios_type_4_init()
672 p->cpuid[0] = eax; in smbios_type_4_init()
673 p->cpuid[1] = edx; in smbios_type_4_init()
675 p->version_str = 0; in smbios_type_4_init()
676 p->voltage = 0; in smbios_type_4_init()
677 p->external_clock = 0; in smbios_type_4_init()
679 p->max_speed = p->current_speed = get_cpu_mhz(); in smbios_type_4_init()
681 p->status = 0x41; /* socket populated, CPU enabled */ in smbios_type_4_init()
682 p->upgrade = 0x01; /* other */ in smbios_type_4_init()
683 p->l1_cache_handle = 0xffff; /* No cache information structure provided. */ in smbios_type_4_init()
684 p->l2_cache_handle = 0xffff; /* No cache information structure provided. */ in smbios_type_4_init()
685 p->l3_cache_handle = 0xffff; /* No cache information structure provided. */ in smbios_type_4_init()
707 struct smbios_type_11 *p = (struct smbios_type_11 *)start; in smbios_type_11_init() local
718 p->header.handle = SMBIOS_HANDLE_TYPE11; in smbios_type_11_init()
722 p->header.type = 11; in smbios_type_11_init()
723 p->header.length = sizeof(struct smbios_type_11); in smbios_type_11_init()
724 p->header.handle = SMBIOS_HANDLE_TYPE11; in smbios_type_11_init()
726 p->count = 0; in smbios_type_11_init()
738 p->count++; in smbios_type_11_init()
742 if ( p->count == 0 ) in smbios_type_11_init()
746 p->count++; in smbios_type_11_init()
757 struct smbios_type_16 *p = (struct smbios_type_16*)start; in smbios_type_16_init() local
759 memset(p, 0, sizeof(*p)); in smbios_type_16_init()
761 p->header.type = 16; in smbios_type_16_init()
762 p->header.handle = SMBIOS_HANDLE_TYPE16; in smbios_type_16_init()
763 p->header.length = sizeof(struct smbios_type_16); in smbios_type_16_init()
765 p->location = 0x01; /* other */ in smbios_type_16_init()
766 p->use = 0x03; /* system memory */ in smbios_type_16_init()
767 p->error_correction = 0x06; /* Multi-bit ECC to make Microsoft happy */ in smbios_type_16_init()
768 p->maximum_capacity = memsize * 1024; in smbios_type_16_init()
769 p->memory_error_information_handle = 0xfffe; /* none provided */ in smbios_type_16_init()
770 p->number_of_memory_devices = nr_mem_devs; in smbios_type_16_init()
782 struct smbios_type_17 *p = (struct smbios_type_17 *)start; in smbios_type_17_init() local
784 memset(p, 0, sizeof(*p)); in smbios_type_17_init()
786 p->header.type = 17; in smbios_type_17_init()
787 p->header.length = sizeof(struct smbios_type_17); in smbios_type_17_init()
788 p->header.handle = SMBIOS_HANDLE_TYPE17 + instance; in smbios_type_17_init()
790 p->physical_memory_array_handle = 0x1000; in smbios_type_17_init()
791 p->total_width = 64; in smbios_type_17_init()
792 p->data_width = 64; in smbios_type_17_init()
794 p->size = memory_size_mb; in smbios_type_17_init()
795 p->form_factor = 0x09; /* DIMM */ in smbios_type_17_init()
796 p->device_set = 0; in smbios_type_17_init()
797 p->device_locator_str = 1; in smbios_type_17_init()
798 p->bank_locator_str = 0; in smbios_type_17_init()
799 p->memory_type = 0x07; /* RAM */ in smbios_type_17_init()
800 p->type_detail = 0; in smbios_type_17_init()
817 struct smbios_type_19 *p = (struct smbios_type_19 *)start; in smbios_type_19_init() local
819 memset(p, 0, sizeof(*p)); in smbios_type_19_init()
821 p->header.type = 19; in smbios_type_19_init()
822 p->header.length = sizeof(struct smbios_type_19); in smbios_type_19_init()
823 p->header.handle = SMBIOS_HANDLE_TYPE19 + instance; in smbios_type_19_init()
825 p->starting_address = instance << 24; in smbios_type_19_init()
826 p->ending_address = p->starting_address + (memory_size_mb << 10) - 1; in smbios_type_19_init()
827 p->memory_array_handle = 0x1000; in smbios_type_19_init()
828 p->partition_width = 1; in smbios_type_19_init()
839 struct smbios_type_20 *p = (struct smbios_type_20 *)start; in smbios_type_20_init() local
841 memset(p, 0, sizeof(*p)); in smbios_type_20_init()
843 p->header.type = 20; in smbios_type_20_init()
844 p->header.length = sizeof(struct smbios_type_20); in smbios_type_20_init()
845 p->header.handle = SMBIOS_HANDLE_TYPE20 + instance; in smbios_type_20_init()
847 p->starting_address = instance << 24; in smbios_type_20_init()
848 p->ending_address = p->starting_address + (memory_size_mb << 10) - 1; in smbios_type_20_init()
849 p->memory_device_handle = 0x1100 + instance; in smbios_type_20_init()
850 p->memory_array_mapped_address_handle = 0x1300 + instance; in smbios_type_20_init()
851 p->partition_row_position = 1; in smbios_type_20_init()
852 p->interleave_position = 0; in smbios_type_20_init()
853 p->interleaved_data_depth = 0; in smbios_type_20_init()
865 struct smbios_type_22 *p = (struct smbios_type_22 *)start; in smbios_type_22_init() local
875 p->header.handle = SMBIOS_HANDLE_TYPE22; in smbios_type_22_init()
883 memset(p, 0, sizeof(*p)); in smbios_type_22_init()
885 p->header.type = 22; in smbios_type_22_init()
886 p->header.length = sizeof(struct smbios_type_22); in smbios_type_22_init()
887 p->header.handle = SMBIOS_HANDLE_TYPE22; in smbios_type_22_init()
889 p->location_str = 1; in smbios_type_22_init()
890 p->manufacturer_str = 2; in smbios_type_22_init()
891 p->manufacturer_date_str = 3; in smbios_type_22_init()
892 p->serial_number_str = 0; in smbios_type_22_init()
893 p->device_name_str = 4; in smbios_type_22_init()
894 p->device_chemistry = 0x2; /* unknown */ in smbios_type_22_init()
895 p->device_capacity = 0; /* unknown */ in smbios_type_22_init()
896 p->device_voltage = 0; /* unknown */ in smbios_type_22_init()
897 p->sbds_version_number = 0; in smbios_type_22_init()
898 p->max_error = 0xff; /* unknown */ in smbios_type_22_init()
899 p->sbds_serial_number = 0; in smbios_type_22_init()
900 p->sbds_manufacturer_date = 0; in smbios_type_22_init()
901 p->sbds_device_chemistry = 0; in smbios_type_22_init()
902 p->design_capacity_multiplier = 0; in smbios_type_22_init()
903 p->oem_specific = 0; in smbios_type_22_init()
930 struct smbios_type_32 *p = (struct smbios_type_32 *)start; in smbios_type_32_init() local
932 memset(p, 0, sizeof(*p)); in smbios_type_32_init()
934 p->header.type = 32; in smbios_type_32_init()
935 p->header.length = sizeof(struct smbios_type_32); in smbios_type_32_init()
936 p->header.handle = SMBIOS_HANDLE_TYPE32; in smbios_type_32_init()
937 memset(p->reserved, 0, 6); in smbios_type_32_init()
938 p->boot_status = 0; /* no errors detected */ in smbios_type_32_init()
949 struct smbios_type_39 *p = (struct smbios_type_39 *)start; in smbios_type_39_init() local
957 p->header.handle = SMBIOS_HANDLE_TYPE39; in smbios_type_39_init()
1001 struct smbios_type_127 *p = (struct smbios_type_127 *)start; in smbios_type_127_init() local
1003 memset(p, 0, sizeof(*p)); in smbios_type_127_init()
1005 p->header.type = 127; in smbios_type_127_init()
1006 p->header.length = sizeof(struct smbios_type_127); in smbios_type_127_init()
1007 p->header.handle = SMBIOS_HANDLE_TYPE127; in smbios_type_127_init()