Fix potentialyl unaligned memory accesses in mflash driver.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1935 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
zwelch 2009-05-27 23:54:16 +00:00
parent 9a8650ec05
commit 19124a34f3
1 changed files with 3 additions and 2 deletions

View File

@ -1126,8 +1126,9 @@ static int mg_set_pll(mg_pll_t *pll)
u8 buff[512];
memset(buff, 0xff, 512);
*((u32 *)&buff[0]) = pll->lock_cyc; /* PLL Lock cycle */
*((u16 *)&buff[4]) = pll->feedback_div; /* PLL Feedback 9bit Divider */
/* PLL Lock cycle and Feedback 9bit Divider */
memcpy(buff, &pll->lock_cyc, sizeof(u32));
memcpy(buff + 4, &pll->feedback_div, sizeof(u16));
buff[6] = pll->input_div; /* PLL Input 5bit Divider */
buff[7] = pll->output_div; /* PLL Output Divider */