[video member=miotatsu stream_platform=twitch project=riscy title="Investigating handle_m_time_interrupt" vod_platform=youtube id=J6JD6yKdKf4 annotator=Miblo]
[0:08][Recap and set the stage for the day, with a special shout-out to Andrew Waterman]
[3:05][Dive back into demo_gpio.c and look into setting mtimecmp to operate on an arbitrary thread]
[4:48][Understanding shifting with relation to the :memory addresses][:blackboard]
[9:01][Jumping in increments, using multiplication][:blackboard :maths]
[11:44][A few words on traditional [:maths mathematics] vs bitwise operations][:optimisation]
[14:01][Continue reading reset_demo()][:research]
[15:57][Refresh our memories on the Real-Time Clock frequency[ref
        site="SiFive Developers"
        page="Platform Reference Manual"
        url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:hardware :research]
[21:38][Consult the documentation on mtime and mtimecmp[ref
    site="SiFive Developers"
    page="E3 Coreplex Manual"
    url=https://static.dev.sifive.com/pdfjs/web/viewer.html?file=https://static.dev.sifive.com/SiFive-E3-Coreplex-v1.2.pdf]][:research]
[24:50][Read deeply about the Real-Time Clock[ref
        site="SiFive Developers"
        page="Platform Reference Manual"
        url=https://www.sifive.com/documentation/freedom-soc/freedom-e300-platform-reference-manual/]][:hardware :research]
[29:50][Wonder why we have both the RTC and the CLINT's mtime and mtimecmp methods][:research]
[31:34][Come to understand handle_m_time_interrupt() in demo_gpio.c][:research]
[34:51][Investigate how it knows to call handle_m_time_interrupt(), and remain bamboozled][:research]
[40:07][@hossein1387][The handle_m_time_interrupt() is defined in init.c]
[40:36][Find handle_m_time_interrupt() in env/freedom-e300-hifive/init.c and investigate what it compiles down to][:research]
[43:30][Discover that handle_trap() is responsible for calling handle_m_time_interrupt()][:research]
[47:17][Consider how trap_entry is working][:research]
[49:49][@hossein1387][Okay, I think I know what's happening. The trap_entry is defined in entry.S]
[50:50][Find a handle_trap call in env/entry.S][:research]
[51:34][@hossein1387][Also take a look at start.S in the same folder]
[51:51][Summarise how handle_trap() works][:research]
[53:39][Begin to understand env/start.S][:research]
[53:49][Program entry point][:blackboard]
[54:39][Our actual entry point in start.S][:research]
[56:15][We will continue tomorrow]
[/video]
