Created
August 2, 2020 11:35
-
-
Save Th3Fanbus/e01265a1f1c5b75360edb6c92b5ceeaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int smbus_stub(int slv_addr, int reg, int length, unsigned char *b) | |
{ | |
struct mrc_params *p = wrapper_params; | |
unsigned char *spd_data; | |
switch (slv_addr) { | |
case FAKE_SPD_ADDR_CH0: | |
spd_data = p->mainboard.dram_data[0]; | |
break; | |
case FAKE_SPD_ADDR_CH1: | |
spd_data = p->mainboard.dram_data[1]; | |
break; | |
default: | |
/* No faking SMBus transaction. */ | |
return 0; | |
} | |
if (spd_data == NULL) | |
return -1; | |
/* Copy the data out of memory. */ | |
memcpy(b, &spd_data[reg], length); | |
return length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment