Skip to content

Instantly share code, notes, and snippets.

View cyyself's full-sized avatar

Yangyu Chen cyyself

View GitHub Profile
.text
.globl _start
.globl poweroff
_start:
csrr a0, mhartid
bnez a0, poweroff
print_mtvec:
li a0, 0x61
jal uart_print
csrr a3, mtvec
@cyyself
cyyself / gist:5cd6d9788239e988b0cf036c85965249
Created January 6, 2023 09:23
gcc_11_2_bug_example.cpp
This file has been truncated, but you can view the full file.
# 0 "Vmycpu_top___024root__DepSet_hcf0db31f__0.cpp"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "Vmycpu_top___024root__DepSet_hcf0db31f__0.cpp"
void debug_eth_print_mac_caps(unsigned long caps) {
if (caps == (~0)) {
printk(KERN_INFO "Internal\n");
}
else {
if (caps & MAC_SYM_PAUSE) printk(KERN_INFO "Has MAC_SYM_PAUSE 0x%x\n", MAC_SYM_PAUSE);
if (caps & MAC_ASYM_PAUSE) printk(KERN_INFO "Has MAC_ASYM_PAUSE 0x%x\n", MAC_ASYM_PAUSE);
if (caps & MAC_2500FD) printk(KERN_INFO "Has MAC_2500FD 0x%x\n", MAC_2500FD);
if (caps & MAC_1000FD) printk(KERN_INFO "Has MAC_1000FD 0x%x\n", MAC_1000FD);
void mtk_eth_soc_debug_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
phylink_set_port_modes(mask);
phylink_set(mask, Autoneg);
phylink_get_linkmodes(mask, PHY_INTERFACE_MODE_2500BASEX, config->mac_capabilities);
// Golden Gate-generated Driver Header
// This contains target-specific preprocessor macro definitions,
// and encodes all required bridge metadata to instantiate bridge drivers.
#ifdef GET_INCLUDES
#include "bridges/master.h"
#endif // GET_INCLUDES
#ifdef GET_SUBSTRUCT_CHECKS
static_assert(offsetof(SIMULATIONMASTER_struct, INIT_DONE) == 0 * sizeof(uint64_t), "invalid INIT_DONE");\
static_assert(offsetof(SIMULATIONMASTER_struct, PRESENCE_READ) == 1 * sizeof(uint64_t), "invalid PRESENCE_READ");\
static_assert(offsetof(SIMULATIONMASTER_struct, PRESENCE_WRITE) == 2 * sizeof(uint64_t), "invalid PRESENCE_WRITE");\
This file has been truncated, but you can view the full file.
diff --git a/src/TimeDate-1.20/t/getdate.t b/src/TimeDate-1.20/t/getdate.t
index 31b577b..82c5850 100644
--- a/src/TimeDate-1.20/t/getdate.t
+++ b/src/TimeDate-1.20/t/getdate.t
@@ -156,7 +156,7 @@ Jul 22 10:00:00 UTC 2002 ;1027332000
!;
require Time::Local;
-my $offset = Time::Local::timegm(0,0,0,1,0,70);
+my $offset = Time::Local::timegm(0,0,0,1,0,1970);
diff --git a/src/TimeDate-1.20/t/getdate.t b/src/TimeDate-1.20/t/getdate.t
index 31b577b..82c5850 100644
--- a/src/TimeDate-1.20/t/getdate.t
+++ b/src/TimeDate-1.20/t/getdate.t
@@ -156,7 +156,7 @@ Jul 22 10:00:00 UTC 2002 ;1027332000
!;
require Time::Local;
-my $offset = Time::Local::timegm(0,0,0,1,0,70);
+my $offset = Time::Local::timegm(0,0,0,1,0,1970);
#!/bin/zsh
numactl --physcpubind=0,1,2,3,4,5,6,7,8 ./mcf_s_peak.mytest-m64 inp.in &
pid=$!
echo $pid | tee /sys/fs/resctrl/mon_groups/group0/tasks
while ps -p $pid > /dev/null; do
sleep 1;
cat /sys/fs/resctrl/mon_groups/group0/mon_data/mon_L3_00/llc_occupancy >> llc_occupancy
done
/dts-v1/;
/ {
compatible = "econet,en7523";
interrupt-parent = <0x01>;
#address-cells = <0x01>;
#size-cells = <0x01>;
chosen {
bootargs = "root=/dev/mtdblock3 ro console=ttyS0,115200n8 earlycon init=/sbin/init";
@cyyself
cyyself / dr5364.md
Last active October 27, 2023 00:46

RAISECOM DR5364 Hack Note

Get Root Telnet

Backup configuration file in http://192.168.10.1/pc/index.html#/settings/system/backup.

You will found an entry <TelnetEntry Active="No" telnet_username="CMCCAdmin" telnet_passwd="aDm8H%MdA" telnet_port="23" />

replace "No" with "Yes" and write it back to get telnet root shell.