/* Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes read.  */
static unsigned long dwarf_read_uleb128(char *addr, unsigned int *ret)
/* Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes read.  */
static unsigned long dwarf_read_uleb128(char *addr, unsigned int *ret)
{
	unsigned int result;
	unsigned char byte;
	int shift, count;
	result = 0;
	shift = 0;
	count = 0;
	while (1) {
		byte = __raw_readb(addr);
		addr++;
		count++;
		result |= (byte & 0x7f) << shift;
		shift += 7;
		if (!(byte & 0x80))
			break;
	}
	*ret = result;
	return count;
}