Пример #1
0
static void s390_elf_corehdr_create(char **elfcorebuf, size_t *elfcorebuf_sz)
{
	Elf64_Phdr *phdr_notes, *phdr_loads;
	int mem_chunk_cnt;
	void *ptr, *hdr;
	u32 alloc_size;
	u64 hdr_off;

	mem_chunk_cnt = get_mem_chunk_cnt();

	alloc_size = 0x1000 + get_cpu_cnt() * 0x300 +
		mem_chunk_cnt * sizeof(Elf64_Phdr);
	hdr = kzalloc_panic(alloc_size);
	/*                 */
	ptr = ehdr_init(hdr, mem_chunk_cnt);
	/*                      */
	phdr_notes = ptr;
	ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr));
	phdr_loads = ptr;
	ptr = PTR_ADD(ptr, sizeof(Elf64_Phdr) * mem_chunk_cnt);
	/*            */
	hdr_off = PTR_DIFF(ptr, hdr);
	ptr = notes_init(phdr_notes, ptr, ((unsigned long) hdr) + hdr_off);
	/*            */
	hdr_off = PTR_DIFF(ptr, hdr);
	loads_init(phdr_loads, ((unsigned long) hdr) + hdr_off);
	*elfcorebuf_sz = hdr_off;
	*elfcorebuf = (void *) relocate((unsigned long) hdr);
	BUG_ON(*elfcorebuf_sz > alloc_size);
}
Пример #2
0
int main()
{
  int i;
  int16_t playbuffer;
  notes_init(SAMPLE_RATE, TUNING);
//  synth_note_on(69, 255);
//  synth_note_on(76, 255);
  synth_note_on(81, 255);
  
  //synth_note_on(75, 255);
  for (i = 0; i < 4000; i++) {

    playbuffer = synth_get_wave(i);
    if (i>2000){
        printf("%d\n", playbuffer);
    }
  }
  printf("\n");

  return 0;
}