MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / ioctl

Method ioctl

source/kernel/devs/devsequencer.cpp:87–122  ·  view source on GitHub ↗

struct synth_info { char name[30]; int device; int synth_type; #define SYNTH_TYPE_FM 0 #define SYNTH_TYPE_SAMPLE 1 #define SYNTH_TYPE_MIDI 2 // Midi interface int synth_subtype; #define FM_TYPE_ADLIB 0x00 #define FM_TYPE_OPL3 0x01 #define MIDI_TYPE_MPU401 0x401 #define SAMPLE_TYPE_BASIC 0x10 #define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC #define SAMPLE_TYPE_WAVEFR

Source from the content-addressed store, hash-verified

85};
86*/
87U32 DevSequencer::ioctl(KThread* thread, U32 request) {
88 //U32 len = (request >> 16) & 0x3FFF;
89 CPU* cpu = thread->cpu;
90 KMemory* memory = thread->memory;
91
92 //bool read = (request & 0x40000000) != 0;
93 bool write = (request & 0x80000000) != 0;
94
95 switch (request & 0xFFFF) {
96 case 0x5100: // LINUX_SNDCTL_SEQ_RESET
97 return 0;
98 case 0x5102: // LINUX_SNDCTL_SYNTH_INFO
99 return 0;
100 case 0x510a: // LINUX_SNDCTL_SEQ_NRSYNTHS
101 if (write)
102 memory->writed(IOCTL_ARG1, 0);
103 return 0;
104 case 0x510b: // LINUX_SNDCTL_SEQ_NRMIDIS
105 if (write)
106 memory->writed(IOCTL_ARG1, audio->midiOutGetNumDevs());
107 return 0;
108 case 0x510c: // LINUX_SNDCTL_MIDI_INFO
109 U32 index = memory->readd(IOCTL_ARG1 + 32);
110 BString name = audio->midiOutGetName(index);
111 U32 len = (U32)name.length();
112 if (len > 31) {
113 len = 31;
114 }
115 memory->memcpy(IOCTL_ARG1, name.c_str(), len);
116 memory->writeb(IOCTL_ARG1 + 31, 0);
117 memory->writed(IOCTL_ARG1+36, 0); // capabilities
118 memory->writed(IOCTL_ARG1+40, 0); // dev_type
119 return 0;
120 }
121 return -K_ENODEV;
122}
123
124U32 DevSequencer::readNative(U8* buffer, U32 len) {
125 return 0;

Callers

nothing calls this directly

Calls 8

memcpyMethod · 0.80
writedMethod · 0.45
midiOutGetNumDevsMethod · 0.45
readdMethod · 0.45
midiOutGetNameMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45
writebMethod · 0.45

Tested by

no test coverage detected