Пример #1
0
def write_kobj_size_output(fp):
    fp.write("/* Non device/stack objects */\n")
    for kobj in kobjects:
        # device handled by default case. Stacks are not currently handled,
        # if they eventually are it will be a special case.
        if kobj == "device" or kobj == "_k_thread_stack_element":
            continue

        fp.write('case %s: return sizeof(struct %s);\n' %
                (kobject_to_enum(kobj), kobj))
Пример #2
0
def write_kobj_types_output(fp):
    fp.write("/* Core kernel objects */\n")
    for kobj in kobjects:
        if kobj == "device":
            continue

        fp.write("%s,\n" % kobject_to_enum(kobj))

    fp.write("/* Driver subsystems */\n")
    for subsystem in subsystems:
        subsystem = subsystem.replace("_driver_api", "").upper()
        fp.write("K_OBJ_DRIVER_%s,\n" % subsystem)
Пример #3
0
def write_kobj_otype_output(fp):
    fp.write("/* Core kernel objects */\n")
    for kobj in kobjects:
        if kobj == "device":
            continue

        fp.write('case %s: return "%s";\n' % (kobject_to_enum(kobj), kobj))

    fp.write("/* Driver subsystems */\n")
    for subsystem in subsystems:
        subsystem = subsystem.replace("_driver_api", "")
        fp.write('case K_OBJ_DRIVER_%s: return "%s driver";\n' %
                 (subsystem.upper(), subsystem))
Пример #4
0
def write_kobj_size_output(fp):
    fp.write("/* Non device/stack objects */\n")
    for kobj, dep in kobjects.items():
        # device handled by default case. Stacks are not currently handled,
        # if they eventually are it will be a special case.
        if kobj == "device" or kobj == "_k_thread_stack_element":
            continue

        if dep:
            fp.write("#ifdef %s\n" % dep)

        fp.write('case %s: ret = sizeof(struct %s); break;\n' %
                 (kobject_to_enum(kobj), kobj))
        if dep:
            fp.write("#endif\n")
Пример #5
0
def write_kobj_otype_output(fp):
    fp.write("/* Core kernel objects */\n")
    for kobj, dep in kobjects.items():
        if kobj == "device":
            continue

        if dep:
            fp.write("#ifdef %s\n" % dep)

        fp.write('case %s: ret = "%s"; break;\n' %
                 (kobject_to_enum(kobj), kobj))
        if dep:
            fp.write("#endif\n")

    fp.write("/* Driver subsystems */\n")
    for subsystem in subsystems:
        subsystem = subsystem.replace("_driver_api", "")
        fp.write('case K_OBJ_DRIVER_%s: ret = "%s driver"; break;\n' %
                 (subsystem.upper(), subsystem))
Пример #6
0
def write_kobj_types_output(fp):
    fp.write("/* Core kernel objects */\n")
    for kobj, obj_info in kobjects.items():
        dep, _ = obj_info
        if kobj == "device":
            continue

        if dep:
            fp.write("#ifdef %s\n" % dep)

        fp.write("%s,\n" % kobject_to_enum(kobj))

        if dep:
            fp.write("#endif\n")

    fp.write("/* Driver subsystems */\n")
    for subsystem in subsystems:
        subsystem = subsystem.replace("_driver_api", "").upper()
        fp.write("K_OBJ_DRIVER_%s,\n" % subsystem)