Lines Matching refs:fp

773 def write_gperf_table(fp, syms, objs, little_endian, static_begin, static_end):  argument
774 fp.write(header)
776 fp.write("static struct k_mutex kernel_mutexes[%d] = {\n"
779 fp.write("Z_MUTEX_INITIALIZER(kernel_mutexes[%d])" % i)
781 fp.write(", ")
782 fp.write("};\n")
785 fp.write("static struct z_futex_data futex_data[%d] = {\n"
788 fp.write("Z_FUTEX_DATA_INITIALIZER(futex_data[%d])" % i)
790 fp.write(", ")
791 fp.write("};\n")
804 fp.write("static uint8_t Z_GENERIC_SECTION(.priv_stacks.noinit) "
809 fp.write("static const struct z_stack_data stack_data[%d] = {\n"
822 fp.write("\t{ %d, (uint8_t *)(&priv_stacks[%d]) }"
825 fp.write(",")
826 fp.write("\n")
828 fp.write("};\n")
832 fp.write("%%\n")
859 fp.write("\"")
862 fp.write(val)
875 fp.write("\", {0}, %s, %s, { .%s = %s }\n" % (obj_type, flags,
883 fp.write(footer)
886 fp.write('\n')
887 fp.write('Z_GENERIC_DOT_SECTION(data)\n')
888 fp.write('uint8_t _thread_idx_map[%d] = {' % (thread_max_bytes))
891 fp.write(' 0x%x, ' % (thread_idx_map[i]))
893 fp.write('};\n')
901 def write_validation_output(fp): argument
902 fp.write("#ifndef DRIVER_VALIDATION_GEN_H\n")
903 fp.write("#define DRIVER_VALIDATION_GEN_H\n")
905 fp.write("""#define K_SYSCALL_DRIVER_GEN(ptr, op, driver_lower_case, driver_upper_case) \\
913 fp.write(driver_macro_tpl % {
918 fp.write("#endif /* DRIVER_VALIDATION_GEN_H */\n")
921 def write_kobj_types_output(fp): argument
922 fp.write("/* Core kernel objects */\n")
929 fp.write("#ifdef %s\n" % dep)
931 fp.write("%s,\n" % kobject_to_enum(kobj))
934 fp.write("#endif\n")
936 fp.write("/* Driver subsystems */\n")
939 fp.write("K_OBJ_DRIVER_%s,\n" % subsystem)
942 def write_kobj_otype_output(fp): argument
943 fp.write("/* Core kernel objects */\n")
950 fp.write("#ifdef %s\n" % dep)
952 fp.write('case %s: ret = "%s"; break;\n' %
955 fp.write("#endif\n")
957 fp.write("/* Driver subsystems */\n")
960 fp.write('case K_OBJ_DRIVER_%s: ret = "%s driver"; break;\n' % (
966 def write_kobj_size_output(fp): argument
967 fp.write("/* Non device/stack objects */\n")
975 fp.write("#ifdef %s\n" % dep)
977 fp.write('case %s: ret = sizeof(struct %s); break;\n' %
980 fp.write("#endif\n")
984 with open(path, "r") as fp:
985 subsys_list = json.load(fp)
1047 with open(args.gperf_output, "w") as fp:
1048 write_gperf_table(fp, syms, objs, elf.little_endian,
1053 with open(args.validation_output, "w") as fp:
1054 write_validation_output(fp)
1057 with open(args.kobj_types_output, "w") as fp:
1058 write_kobj_types_output(fp)
1061 with open(args.kobj_otype_output, "w") as fp:
1062 write_kobj_otype_output(fp)
1065 with open(args.kobj_size_output, "w") as fp:
1066 write_kobj_size_output(fp)