From c459c8278ed2dc84100693eab93389a0df9429bd Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Mon, 31 Oct 2016 09:04:09 -0700 Subject: ec: Improve efficiency of host command dispatcher Use binary search in host command lookup dispatcher BUG=chrome-os-partner:570895 TEST=manual testing on kevin - Kevin boots - ectool hello make buildall -j Verify *.smap hcmds section is sorted: 100bca94 R __hcmds 100bca94 R __host_cmd_0x0000 100bcaa0 R __host_cmd_0x0001 100bcaac R __host_cmd_0x0002 100bcab8 R __host_cmd_0x0003 100bcac4 R __host_cmd_0x0004 100bcad0 R __host_cmd_0x0005 100bcadc R __host_cmd_0x0006 100bcae8 R __host_cmd_0x0007 100bcaf4 R __host_cmd_0x0008 100bcb00 R __host_cmd_0x0009 100bcb0c R __host_cmd_0x000a 100bcb18 R __host_cmd_0x000b 100bcb24 R __host_cmd_0x000d 100bcb30 R __host_cmd_0x0010 100bcb3c R __host_cmd_0x0011 100bcb48 R __host_cmd_0x0012 100bcb54 R __host_cmd_0x0013 100bcb60 R __host_cmd_0x0015 100bcb6c R __host_cmd_0x0016 100bcb78 R __host_cmd_0x0017 100bcb84 R __host_cmd_0x0025 100bcb90 R __host_cmd_0x0026 100bcb9c R __host_cmd_0x0029 100bcba8 R __host_cmd_0x002a 100bcbb4 R __host_cmd_0x002b 100bcbc0 R __host_cmd_0x002c 100bcbcc R __host_cmd_0x0044 100bcbd8 R __host_cmd_0x0045 100bcbe4 R __host_cmd_0x0046 100bcbf0 R __host_cmd_0x0047 100bcbfc R __host_cmd_0x0061 100bcc08 R __host_cmd_0x0062 100bcc14 R __host_cmd_0x0064 100bcc20 R __host_cmd_0x0065 100bcc2c R __host_cmd_0x0067 100bcc38 R __host_cmd_0x0087 100bcc44 R __host_cmd_0x008c 100bcc50 R __host_cmd_0x008d 100bcc5c R __host_cmd_0x008f 100bcc68 R __host_cmd_0x0092 100bcc74 R __host_cmd_0x0093 100bcc80 R __host_cmd_0x0096 100bcc8c R __host_cmd_0x0097 100bcc98 R __host_cmd_0x0098 100bcca4 R __host_cmd_0x0099 100bccb0 R __host_cmd_0x009e 100bccbc R __host_cmd_0x00a0 100bccc8 R __host_cmd_0x00a1 100bccd4 R __host_cmd_0x00a8 100bcce0 R __host_cmd_0x00a9 100bccec R __host_cmd_0x00b6 100bccf8 R __host_cmd_0x00b7 100bcd04 R __host_cmd_0x00d2 100bcd10 R __host_cmd_0x00d3 100bcd1c R __host_cmd_0x00db 100bcd28 R __host_cmd_0x0101 100bcd34 R __host_cmd_0x0102 100bcd40 R __host_cmd_0x0103 100bcd4c R __host_cmd_0x0104 100bcd58 R __host_cmd_0x0110 100bcd64 R __host_cmd_0x0111 100bcd70 R __host_cmd_0x0112 100bcd7c R __host_cmd_0x0113 100bcd88 R __host_cmd_0x0114 100bcd94 R __host_cmd_0x0115 100bcda0 R __host_cmd_0x0116 100bcdac R __host_cmd_0x0117 100bcdb8 R __host_cmd_0x0118 100bcdc4 R __host_cmd_0x011a 100bcdd0 R __evt_src_EC_MKBP_EVENT_KEY_MATRIX 100bcdd0 R __hcmds_end BRANCH=none Change-Id: Ideb9951b318763f71915e2c4e5052f4b4bfab173 Reviewed-on: https://chromium-review.googlesource.com/405528 Commit-Ready: Sam Hurst Tested-by: Sam Hurst Reviewed-by: Randall Spangler --- core/cortex-m/ec.lds.S | 2 +- core/cortex-m0/ec.lds.S | 2 +- core/host/host_exe.lds | 2 +- core/minute-ia/ec.lds.S | 2 +- core/nds32/ec.lds.S | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 9e791f0380..90212a5389 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -123,7 +123,7 @@ SECTIONS . = ALIGN(4); __hcmds = .; - KEEP(*(.rodata.hcmds)) + KEEP(*(SORT(.rodata.hcmds*))) __hcmds_end = .; . = ALIGN(4); diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S index d2bee481a9..6102bfa973 100644 --- a/core/cortex-m0/ec.lds.S +++ b/core/cortex-m0/ec.lds.S @@ -70,7 +70,7 @@ SECTIONS . = ALIGN(4); __hcmds = .; - KEEP(*(.rodata.hcmds)) + KEEP(*(SORT(.rodata.hcmds*))) __hcmds_end = .; . = ALIGN(4); diff --git a/core/host/host_exe.lds b/core/host/host_exe.lds index 0763002945..2c4eabdeeb 100644 --- a/core/host/host_exe.lds +++ b/core/host/host_exe.lds @@ -16,7 +16,7 @@ SECTIONS { . = ALIGN(8); __hcmds = .; - *(.rodata.hcmds) + *(SORT(.rodata.hcmds*)) __hcmds_end = .; . = ALIGN(4); diff --git a/core/minute-ia/ec.lds.S b/core/minute-ia/ec.lds.S index 2bdcc91e25..63db8f1e2a 100644 --- a/core/minute-ia/ec.lds.S +++ b/core/minute-ia/ec.lds.S @@ -41,7 +41,7 @@ SECTIONS . = ALIGN(4); __hcmds = .; - KEEP(*(.rodata.hcmds)) + KEEP(*(SORT(.rodata.hcmds*))) __hcmds_end = .; . = ALIGN(4); diff --git a/core/nds32/ec.lds.S b/core/nds32/ec.lds.S index 43b905c899..a888654781 100644 --- a/core/nds32/ec.lds.S +++ b/core/nds32/ec.lds.S @@ -65,7 +65,7 @@ SECTIONS . = ALIGN(4); __hcmds = .; - KEEP(*(.rodata.hcmds)) + KEEP(*(SORT(.rodata.hcmds*))) __hcmds_end = .; . = ALIGN(4); -- cgit v1.2.1