xref: /inferno-os/libnandfs/extracttags.c (revision 1981fff245dfce579ef416fa767eb69d462039e9)
1  #include "logfsos.h"
2  #include "logfs.h"
3  #include "nandfs.h"
4  #include "local.h"
5  
6  void
7  _nandfsextracttags(NandfsAuxiliary *hdr, NandfsTags *tags)
8  {
9  	ulong tmp;
10  	tmp = (getbig2(hdr->nerasemagicmsw) << 16) | getbig2(hdr->nerasemagiclsw);
11  	if (tmp == 0xffffffff) {
12  		tags->nerase = 0xffffffff;
13  		tags->magic = 0xff;
14  	}
15  	else {
16  		tags->nerase = (tmp >> 6) & 0x3ffff;
17  		tags->magic = tmp >> 24;
18  	}
19  	tmp = getbig4(hdr->parth);
20  	if (tmp != 0xffffffff)
21  		tags->path = tmp >> 6;
22  	else
23  		tags->path = 0xffffffff;
24  	tags->tag = hdr->tag;
25  }
26  
27