Lines Matching full:print

39 		print("enum %s {" % self.name)
42 print("\t%s = 0x%08x," % (name, value))
44 print("\t%s = %d," % (name, value))
45 print("};\n")
116 print(name + ('\t' * tab_count) + value)
165 print("#ifndef NDEBUG")
172 print(" assert((%-40s & 0x%08x) == 0);" % (val, 0xffffffff ^ mask(0 , f.high - f.low)))
173 print(" assert((%-40s & 0x%08x) == 0);" % ("fields.unknown", known_mask))
174 print("#endif\n")
176 print(" return (struct fd_reg_pair) {")
178 print(" .reg = REG_%s(__i)," % reg.full_name)
180 print(" .reg = REG_%s," % reg.full_name)
182 print(" .value =")
188 print(" (%-40s << %2d) |" % (val, f.low))
192 print(" fields.unknown | fields.%s," % (value_name,))
196 print(" .bo = fields.bo,")
197 print(" .is_address = true,")
199 print(" .bo_write = true,")
200 print(" .bo_offset = fields.bo_offset,")
201 print(" .bo_shift = %d," % address.shr)
202 print(" .bo_low = %d," % address.low)
204 print(" };")
212 print("struct %s {" % prefix)
229 print("};\n")
232 print("static inline struct fd_reg_pair\npack_%s(uint32_t __i, struct %s fields)\n{" %
235 print("static inline struct fd_reg_pair\npack_%s(struct %s fields)\n{" %
240 print("\n}\n")
248 print("#define %s(__i, ...) pack_%s(__i, __struct_cast(%s) { __VA_ARGS__ })%s\n" %
251 print("#define %s(...) pack_%s(__struct_cast(%s) { __VA_ARGS__ })%s\n" %
273 print("static inline uint32_t %s(%s val)\n{" % (name, type))
275 print("\tassert(!(val & 0x%x));" % mask(0, f.shr - 1))
276 print("\treturn ((%s) << %s__SHIFT) & %s__MASK;\n}" % (val, name, name))
277 print()
344 print("static inline uint32_t __offset_%s(%s idx)" % (self.local_name, self.index_ctype()))
345 print("{\n\tswitch (idx) {")
348 print("\t\tcase %s: return %s;" % (val, offset))
351 print("\t\tcase %d: return %s;" % (idx, offset))
352 print("\t\tdefault: return INVALID_IDX(idx);")
353 print("\t}\n}")
406print("static inline uint32_t REG_%s(%s) { return 0x%08x + %s; }" % (self.full_name, proto, offset…
420 print("\tREG_%s = 0x%08x" % (self.full_name, self.offset))
577 print("lxml not found, skipping validation", file=sys.stderr)
727 print("#ifdef __cplusplus")
730 print("template<chip CHIP> constexpr inline uint16_t %s_REGS[] = {};" % (usage.upper()))
748 print("template<> constexpr inline uint16_t %s_REGS<%s>[] = {" % (usage.upper(), variant))
750 print("\t%s," % hex(offset))
751 print("};")
753 print("#endif")
787 print("#ifdef __cplusplus")
788 print("struct __%s {" % regname)
798 print(" /* %s fields: */" % variant)
817 print(" /* fallback fields: */")
824 print("};")
827 print("template <%s %s>" % (varenum, varenum.upper()))
828 print("static inline struct fd_reg_pair")
834 print("__%s(%sstruct __%s fields) {" % (regname, xtra, regname))
836 print(" if (%s == %s) {" % (varenum.upper(), variant))
839 print(" } else")
840 print(" assert(!\"invalid variant\");")
841 print("}")
848print("#define %s(VARIANT, %s...) __%s<VARIANT>(%s{__VA_ARGS__})%s" % (regname, xtravar, regname, …
849 print("#endif /* __cplusplus */")
865 print(e, file=sys.stderr)
868 print("#ifndef %s\n#define %s\n" % (guard, guard))
870 print("""/* Autogenerated file, DO NOT EDIT manually!
886 print("- " + filepath + pad + " (" + filesize + " bytes, from " + filetime + ")")
889 print()
890 print("Copyright (C) %s-%s by the following authors:" % (p.copyright_year, current_year))
892 print("- " + author)
894 print(p.license)
895 print("*/")
897 print()
898 print("#ifdef __KERNEL__")
899 print("#include <linux/bug.h>")
900 print("#define assert(x) BUG_ON(!(x))")
901 print("#else")
902 print("#include <assert.h>")
903 print("#endif")
904 print()
906 print("#ifdef __cplusplus")
907 print("#define __struct_cast(X)")
908 print("#else")
909 print("#define __struct_cast(X) (struct X)")
910 print("#endif")
911 print()
915 print("\n#endif /* %s */" % guard)
934 print(e, file=sys.stderr)
939 print("from enum import IntEnum")
940 print("class %sRegs(IntEnum):" % file_name.upper())