view target-utils/libload/cmd_memdump_machine.c @ 884:353daaa6014d

gsm-fw/gpf/conf/gsmcomp.c: increased max partition in the voice-only config The code we got from TCS211 had the maximum prim pool partition size set to 900 bytes in the voice-only config (no FAX_AND_DATA, no GPRS) and to 1600 bytes in every other config. As it turns out, this "minimized" config breaks when the AT command interface is used with %CPI enabled, as the responsible code in ATI does an ACI_MALLOC of 1012 bytes. TI may have considered this case to be unsupported usage (perhaps they didn't care about the combination of a voice-only PS with AT command control), but we do want this use case to work without crashing. Solution: I made the largest prim pool the same as it is with FAX_AND_DATA: 3 partitions of 1600 bytes.
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sat, 27 Jun 2015 07:31:30 +0000
parents 9ee91bc6057c
children
line wrap: on
line source

/*
 * This is a machine-oriented memory dump command.  The output is in the
 * form of S3 records.
 */

#include <sys/types.h>
#include "types.h"

void
cmd_memdump_machine(argbulk)
	char *argbulk;
{
	char *argv[3];
	u_long start, length;
	u_long addr;
	u_char srbuf[0x86], cksum;
	int i;

	if (parse_args(argbulk, 2, 2, argv, 0) < 0)
		return;
	if (parse_hexarg(argv[0], 8, &start) < 0) {
		printf("ERROR: arg1 must be a valid 32-bit hex address\n");
		return;
	}
	if (parse_hexarg(argv[1], 8, &length) < 0) {
	    printf("ERROR: arg2 must be a valid 32-bit hex value (length)\n");
		return;
	}
	if (start & 0x7F || length & 0x7F) {
	   printf("ERROR: implementation limit: 128-byte alignment required\n");
		return;
	}
	srbuf[0] = 0x85;
	for (addr = start; addr < start + length; addr += 0x80) {
		srbuf[1] = addr >> 24;
		srbuf[2] = addr >> 16;
		srbuf[3] = addr >> 8;
		srbuf[4] = addr;
		bcopy(addr, srbuf + 5, 0x80);
		cksum = 0;
		for (i = 0; i < 0x85; i++)
			cksum += srbuf[i];
		srbuf[i] = ~cksum;
		putchar('S');
		putchar('3');
		for (i = 0; i < 0x86; i++)
			printf("%02X", srbuf[i]);
		putchar('\n');
	}
}