Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * (C) Copyright Linaro, Ltd. 2018
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * (C) Copyright Arm Holdings.  2017
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <stdlib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <yaml.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "dtc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "srcpos.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) char *yaml_error_name[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 	[YAML_NO_ERROR] = "no error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 	[YAML_MEMORY_ERROR] = "memory error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	[YAML_READER_ERROR] = "reader error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	[YAML_SCANNER_ERROR] = "scanner error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	[YAML_PARSER_ERROR] = "parser error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	[YAML_COMPOSER_ERROR] = "composer error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	[YAML_WRITER_ERROR] = "writer error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	[YAML_EMITTER_ERROR] = "emitter error",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #define yaml_emitter_emit_or_die(emitter, event) (			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) {									\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	if (!yaml_emitter_emit(emitter, event))				\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 		die("yaml '%s': %s in %s, line %i\n",			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 		    yaml_error_name[(emitter)->error], 			\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 		    (emitter)->problem, __func__, __LINE__);		\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static void yaml_propval_int(yaml_emitter_t *emitter, struct marker *markers, char *data, unsigned int len, int width)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	yaml_event_t event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	void *tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	unsigned int off, start_offset = markers->offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	switch(width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 		case 1: tag = "!u8"; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 		case 2: tag = "!u16"; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		case 4: tag = "!u32"; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		case 8: tag = "!u64"; break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			die("Invalid width %i", width);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	assert(len % width == 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	yaml_sequence_start_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		(yaml_char_t *)tag, width == 4, YAML_FLOW_SEQUENCE_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	for (off = 0; off < len; off += width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		char buf[32];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		struct marker *m;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		bool is_phandle = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 		switch(width) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		case 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 			sprintf(buf, "0x%"PRIx8, *(uint8_t*)(data + off));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		case 2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 			sprintf(buf, "0x%"PRIx16, dtb_ld16(data + off));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		case 4:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			sprintf(buf, "0x%"PRIx32, dtb_ld32(data + off));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			m = markers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 			is_phandle = false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			for_each_marker_of_type(m, REF_PHANDLE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 				if (m->offset == (start_offset + off)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 					is_phandle = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 					break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 				}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		case 8:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 			sprintf(buf, "0x%"PRIx64, dtb_ld64(data + off));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		if (is_phandle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 			yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 				(yaml_char_t*)"!phandle", (yaml_char_t *)buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 				strlen(buf), 0, 0, YAML_PLAIN_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 			yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 				(yaml_char_t*)YAML_INT_TAG, (yaml_char_t *)buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 				strlen(buf), 1, 1, YAML_PLAIN_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	yaml_sequence_end_event_initialize(&event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) static void yaml_propval_string(yaml_emitter_t *emitter, char *str, int len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	yaml_event_t event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	assert(str[len-1] == '\0');
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	/* Make sure the entire string is in the lower 7-bit ascii range */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	for (i = 0; i < len; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		assert(isascii(str[i]));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		(yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)str,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		len-1, 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) static void yaml_propval(yaml_emitter_t *emitter, struct property *prop)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	yaml_event_t event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	unsigned int len = prop->val.len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	struct marker *m = prop->val.markers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	/* Emit the property name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		(yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)prop->name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		strlen(prop->name), 1, 1, YAML_PLAIN_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	/* Boolean properties are easiest to deal with. Length is zero, so just emit 'true' */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	if (len == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 			(yaml_char_t *)YAML_BOOL_TAG,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 			(yaml_char_t*)"true",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 			strlen("true"), 1, 0, YAML_PLAIN_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	if (!m)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		die("No markers present in property '%s' value\n", prop->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	yaml_sequence_start_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		(yaml_char_t *)YAML_SEQ_TAG, 1, YAML_FLOW_SEQUENCE_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	for_each_marker(m) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		int chunk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		char *data = &prop->val.val[m->offset];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		if (m->type < TYPE_UINT8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		chunk_len = type_marker_length(m) ? : len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		assert(chunk_len > 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		len -= chunk_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		switch(m->type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		case TYPE_UINT16:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 			yaml_propval_int(emitter, m, data, chunk_len, 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		case TYPE_UINT32:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 			yaml_propval_int(emitter, m, data, chunk_len, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		case TYPE_UINT64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			yaml_propval_int(emitter, m, data, chunk_len, 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		case TYPE_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 			yaml_propval_string(emitter, data, chunk_len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 			yaml_propval_int(emitter, m, data, chunk_len, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	yaml_sequence_end_event_initialize(&event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) static void yaml_tree(struct node *tree, yaml_emitter_t *emitter)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	struct property *prop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	struct node *child;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	yaml_event_t event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	if (tree->deleted)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	yaml_mapping_start_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		(yaml_char_t *)YAML_MAP_TAG, 1, YAML_ANY_MAPPING_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	for_each_property(tree, prop)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		yaml_propval(emitter, prop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	/* Loop over all the children, emitting them into the map */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	for_each_child(tree, child) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		yaml_scalar_event_initialize(&event, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			(yaml_char_t *)YAML_STR_TAG, (yaml_char_t*)child->name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 			strlen(child->name), 1, 0, YAML_PLAIN_SCALAR_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		yaml_tree(child, emitter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	yaml_mapping_end_event_initialize(&event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	yaml_emitter_emit_or_die(emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) void dt_to_yaml(FILE *f, struct dt_info *dti)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	yaml_emitter_t emitter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	yaml_event_t event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	yaml_emitter_initialize(&emitter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	yaml_emitter_set_output_file(&emitter, f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	yaml_stream_start_event_initialize(&event, YAML_UTF8_ENCODING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	yaml_document_start_event_initialize(&event, NULL, NULL, NULL, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	yaml_sequence_start_event_initialize(&event, NULL, (yaml_char_t *)YAML_SEQ_TAG, 1, YAML_ANY_SEQUENCE_STYLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	yaml_tree(dti->dt, &emitter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	yaml_sequence_end_event_initialize(&event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	yaml_document_end_event_initialize(&event, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	yaml_stream_end_event_initialize(&event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	yaml_emitter_emit_or_die(&emitter, &event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	yaml_emitter_delete(&emitter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) }