From 468e8b4fb6a3775e0917f4603e9eb4aec6c1aaad Mon Sep 17 00:00:00 2001 From: AceVest Date: Tue, 8 Dec 2015 20:30:52 +0800 Subject: [PATCH] learn go --- ish/Cmd.cc | 1 + ish/Common.cc | 2 +- ish/Parser.cc | 2 ++ ish/Scanner.cc | 1 + learn/doc/ir.txt | 7 ----- learn/doc/linux | 11 -------- learn/doc/mac | 13 ---------- learn/go/interfaces.go | 47 ++++++++++++++++++++++++++++++++++ learn/go/methods.go | 1 + learn/go/struct.go | 26 ++++++++++++++++--- learn/server/.Building.lock | 0 learn/server/.sconsign.dblite | Bin 3979 -> 0 bytes learn/server/BLADE_ROOT | 0 learn/server/BUILD | 6 ----- learn/server/config.h | 10 -------- learn/server/server.cpp | 16 ------------ tools/comm/cpuid.cc | 42 +++++++++++++++++++++++++----- 17 files changed, 112 insertions(+), 73 deletions(-) delete mode 100644 learn/doc/ir.txt delete mode 100644 learn/doc/linux delete mode 100644 learn/server/.Building.lock delete mode 100644 learn/server/.sconsign.dblite delete mode 100644 learn/server/BLADE_ROOT delete mode 100644 learn/server/BUILD delete mode 100644 learn/server/config.h delete mode 100644 learn/server/server.cpp diff --git a/ish/Cmd.cc b/ish/Cmd.cc index 1f4f481..eb3355f 100644 --- a/ish/Cmd.cc +++ b/ish/Cmd.cc @@ -166,6 +166,7 @@ ExitCode cmd::ExecuteCommand(char **argv) //} + return 0; } #ifdef DEBUG_CMD diff --git a/ish/Common.cc b/ish/Common.cc index b6384d4..bb7ee73 100644 --- a/ish/Common.cc +++ b/ish/Common.cc @@ -4,7 +4,7 @@ void fatal(const char *err_msg, int n) { - fprintf(stderr,"Error: %s,%s\n",err_msg); + fprintf(stderr,"Error: %s\n",err_msg); exit(n); } void *my_malloc(size_t size) diff --git a/ish/Parser.cc b/ish/Parser.cc index 58266c1..2b300aa 100644 --- a/ish/Parser.cc +++ b/ish/Parser.cc @@ -244,7 +244,9 @@ ExitCode Parser::ExecuteCmd() g_redirectInFlag = g_redirectOutFlag = false; + return 0; } + ExitCode Parser::Exp() { /*if(m_token != STRING && m_token != GETVAR) diff --git a/ish/Scanner.cc b/ish/Scanner.cc index bcd6c51..b56fca1 100644 --- a/ish/Scanner.cc +++ b/ish/Scanner.cc @@ -275,6 +275,7 @@ void Scanner::printToken(TokenType t) const case GE: cout<<"GE"<2lL6t&}Bw!AO#t|U&P#<48!WVgg|?8JK_i)h+{5Xj-sqrj1TO{qW%5a@UG zv0u@bKJ_d5)`xyTKcRQHSd{J5eQ1HkFoe-ia&TLmtDPQm4^$hg0@TP$PGI?{b z@*O?*tMyu?>cZe&r#aB5zN3D_es=~#yWjls+BCcU>h~0~2X7xY9ka&?gA89E*p15Wkb*=dzj8!%zvC6}Jjn(M=)#W;Y$WTSfG!;}Tn zW}jn|hF?8_nL{&saWiiCaNB}eyd!=(-3G4jCf2$1vzh z7<4esCXWjDQ*j>z@UT5@K7dc+xO*KeyVr3k=A!^suf}{F$6Vtv3p{4CV2*HJxT=ht zI;FNx%e}n`^%6XF|D&WH;bqU7IfdF(l0@BeMWQ>3B-&IJ9oLpb&k=~|z;H~{k%Qaa zEt-yE1!7sHwUDCeSVW8Q04CBjowQ)eoWGRT^(2|RxYKr;$TJq)Hiy=m{`oozWc_4y z6=v-ex96_m_PhlPEp9KGxuWjLs^DspDo|VUY(e&@Y7Jnq0&xvTrk>_%gm|iA%Z8vA4Qdc%@5sR`t?AfiH`f`gm`_%Y zUv9p6lUu9jR>~Wt7hC1r8p%bQ+xr_Yj>Gk4ysT_)ZXO-rKkgoxrOmBlxZf_x2Npa` zp^S(>wEHzSmjtEfQCHVJRj`R_>#jmPQIKs-lwE-oT~B~Vh|;-*D6hyYC9>539=D5Z zEr3EI?l4}KB~N0U94xN?dH}^dm-dW>!U|Dgc?7n2$S}tu!y`yx&#*Vd`4X|TtOw4b8bK>&wb2t--EpqQlEvLZ;TTrAp# zL3Pz8M0XvPDzZ!z)x#s^pN`=XZMI@IR`z!e_tFXoHxkNMO0PD`FE0q6TdC~tJbS)V zO0MI#WVv11IN18?sI(W|QMvezDr&96U&9eE=Bv~>UI$R(=iqZVk%~=;BvRGW2{ovv zx>TaJBB-7y7F87mgB%)_W1-+|7;aB<`Lo28^qmmG6aK%O3n>ROxa(pC+fB+4dW7y| zE_kkCI9kyol!%I`5?#Vx={mNo%2H9&X*?B%cYj#trA_S12_=6o%T1gvA;n+^(RBF{8MLWGR!VM?QVUTMqNp& zKjdt?uXVOP+}ZX9(0Ac%``N{#($l=i zxawk3ow@v5)D6s`wif-d6*GEG33~z-^QHy~tzz;<`7aa`-%(P&0A|{(VOYEm4ZFFt zNu0l?^a~a&wtC1C&T4dqhNk16Aj%5*LtWNfY=C01sJg0W!1862n6uyx5|zd3xEsK| vJj+HsgSQV%*-d?ejV814zcq<1l#xlyMsH*>${YRDBQ_fPr_dz&g=XO|NHN$P diff --git a/learn/server/BLADE_ROOT b/learn/server/BLADE_ROOT deleted file mode 100644 index e69de29..0000000 diff --git a/learn/server/BUILD b/learn/server/BUILD deleted file mode 100644 index 84769a6..0000000 --- a/learn/server/BUILD +++ /dev/null @@ -1,6 +0,0 @@ -cc_binary( - name = 'server', - srcs = [ - 'server.cpp', - ], -) diff --git a/learn/server/config.h b/learn/server/config.h deleted file mode 100644 index 4c67455..0000000 --- a/learn/server/config.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: config.h - * Author: Zhao Yanbai - * Tue May 12 15:31:22 2015 - * Description: none - * ------------------------------------------------------------------------ - */ - -#pragma once diff --git a/learn/server/server.cpp b/learn/server/server.cpp deleted file mode 100644 index 15547bb..0000000 --- a/learn/server/server.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: server.cpp - * Author: Zhao Yanbai - * Tue May 12 15:30:58 2015 - * Description: none - * ------------------------------------------------------------------------ - */ -#include -using namespace std; - -int main(int argc, char *argv[]) { - - cout << "Server is Starting ... " << endl; - return 0; -} diff --git a/tools/comm/cpuid.cc b/tools/comm/cpuid.cc index 77bae5c..9ba8ae7 100644 --- a/tools/comm/cpuid.cc +++ b/tools/comm/cpuid.cc @@ -108,17 +108,47 @@ int main() "CR4.OSFXSR is available)") TEST_FEATURE(fv, 25, "SSE: SSE Extensions") TEST_FEATURE(fv, 26, "SSE2: SSE2 Extensions") - //TEST_FEATURE(fv, 27, "Reserved") + TEST_FEATURE(fv, 27, "SS: CPU Cache Supports Self-Snoop") TEST_FEATURE(fv, 28, "Hyper Threading Technology") TEST_FEATURE(fv, 29, "TM: Thermal Monitor") - //TEST_FEATURE(fv, 30, "Reserved") + TEST_FEATURE(fv, 30, "IA64 Processor Emulating X86") TEST_FEATURE(fv, 31, "PBE: Pending Break Enable") - - - - + fv = r.ecx; + printf("-------------\n"); + TEST_FEATURE(fv, 0, "SSE3: Prescott New Instructions-SSE3 (PNI)") + TEST_FEATURE(fv, 1, "PCLMULQDQ Support") + TEST_FEATURE(fv, 2, "64Bit Debug Store (EDX Bit21)") + TEST_FEATURE(fv, 3, "MONITOR and MWAIT Instructions (SSE3)") + TEST_FEATURE(fv, 4, "CPL Qualified Debug Store") + TEST_FEATURE(fv, 5, "VMX: Virtual Machine eXtensions") + TEST_FEATURE(fv, 6, "SMX: Safer Mode Extensions") + TEST_FEATURE(fv, 7, "EST: Enhanced SpeedStep") + TEST_FEATURE(fv, 8, "TM2: Thermal Monitor 2") + TEST_FEATURE(fv, 9, "SSSE3: Supplemental SSE3 Instructions") + TEST_FEATURE(fv, 10, "L1 Context ID") + TEST_FEATURE(fv, 11, "SDBG: Silicon Debug Interface") + TEST_FEATURE(fv, 12, "FMA: Fused Multiply-add (FMA3)") + TEST_FEATURE(fv, 13, "CX16: CMPXCHG16B Instructions") + TEST_FEATURE(fv, 14, "XTPR: Can Disable Sending Task Priority Messages") + TEST_FEATURE(fv, 15, "PDCM: Perfmon & Debug Capability") + //TEST_FEATURE(fv, 16, "Reserved") + TEST_FEATURE(fv, 17, "PCID: Process Context Identifiers (CR4 bit 17)") + TEST_FEATURE(fv, 18, "DCA: Direct Cache Access for DMA Writes") + TEST_FEATURE(fv, 19, "SSE4.1: SSE4.1 Instructions") + TEST_FEATURE(fv, 20, "SSE4.2: SSE4.2 Instructions") + TEST_FEATURE(fv, 21, "X2APIC: x2APIC Support") + TEST_FEATURE(fv, 22, "MOVBE: MOVBE Instruction (big-endian)") + TEST_FEATURE(fv, 23, "POPCNT: POPCNT Instruction") + TEST_FEATURE(fv, 24, "TSC-DEADLINE: APIC Supports One-Shot Operation Using a TSC Deadline Value") + TEST_FEATURE(fv, 25, "AES: AES Instruction Set") + TEST_FEATURE(fv, 26, "XSAVE: XSAVE, XRESTOR, XSETBV, XGETBV") + TEST_FEATURE(fv, 27, "OSXSAVE: XSAVE Enabled by OS") + TEST_FEATURE(fv, 28, "AVX: Advanced Vector Extensions") + TEST_FEATURE(fv, 29, "F16C: F16C (Half-Precision) FP Support") + TEST_FEATURE(fv, 30, "RDRND: RDRAND (On-Chip Random Number Generator) Support") + TEST_FEATURE(fv, 31, "HYPERVISOR: Running on a Hypervisor (Always 0 on a Real CPU, But Also With Some Hypervisors") /**********************Get CPU's SERIAL Number*********************/ -- 2.44.0